Generated by Cython 3.0.0

Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.

Raw output: clm.c

+0001: # cython: c_string_type=unicode
  __pyx_t_37 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_37) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
 0002: # cython: c_string_encoding=utf8
 0003: 
+0004: import ctypes
  __pyx_t_43 = __Pyx_ImportDottedModule(__pyx_n_s_ctypes, NULL); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_43) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
+0005: from functools import singledispatch, partial
  __pyx_t_43 = PyList_New(2); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_INCREF(__pyx_n_s_singledispatch);
  __Pyx_GIVEREF(__pyx_n_s_singledispatch);
  PyList_SET_ITEM(__pyx_t_43, 0, __pyx_n_s_singledispatch);
  __Pyx_INCREF(__pyx_n_s_partial);
  __Pyx_GIVEREF(__pyx_n_s_partial);
  PyList_SET_ITEM(__pyx_t_43, 1, __pyx_n_s_partial);
  __pyx_t_41 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_43, 0); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __pyx_t_43 = __Pyx_ImportFrom(__pyx_t_41, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_singledispatch, __pyx_t_43) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __pyx_t_43 = __Pyx_ImportFrom(__pyx_t_41, __pyx_n_s_partial); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_43) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0006: import math
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_math, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_41) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0007: import random
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_random, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_41) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0008: import subprocess
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_subprocess, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_41) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0009: import tempfile
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_tempfile, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_41) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0010: import time
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_41) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0011: import types
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_types, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_41) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
 0012: import cython
 0013: from cython.cimports.cpython.mem import PyMem_Malloc, PyMem_Realloc, PyMem_Free
 0014: from cython cimport view
+0015: import numpy as np
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_41) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
 0016: cimport numpy as np
+0017: import numpy.typing as npt
  __pyx_t_41 = __Pyx_ImportDottedModule(__pyx_n_s_numpy_typing, __pyx_tuple__96); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_npt, __pyx_t_41) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_numpy, __pyx_n_s_typing); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
 0018: cimport pysndlib.cclm as cclm
 0019: cimport pysndlib.csndlib as csndlib
+0020: from pysndlib.sndlib import Sample, Header
  __pyx_t_41 = PyList_New(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_INCREF(__pyx_n_s_Sample);
  __Pyx_GIVEREF(__pyx_n_s_Sample);
  PyList_SET_ITEM(__pyx_t_41, 0, __pyx_n_s_Sample);
  __Pyx_INCREF(__pyx_n_s_Header);
  __Pyx_GIVEREF(__pyx_n_s_Header);
  PyList_SET_ITEM(__pyx_t_41, 1, __pyx_n_s_Header);
  __pyx_t_43 = __Pyx_Import(__pyx_n_s_pysndlib_sndlib, __pyx_t_41, 0); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_ImportFrom(__pyx_t_43, __pyx_n_s_Sample); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sample, __pyx_t_41) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_ImportFrom(__pyx_t_43, __pyx_n_s_Header); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Header, __pyx_t_41) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
+0021: import sys
  __pyx_t_43 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_43) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
 0022: 
 0023: 
 0024: 
 0025: 
 0026: 
+0027: np.import_array()
  __pyx_t_44 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_44 == ((int)-1))) __PYX_ERR(0, 27, __pyx_L1_error)
 0028: 
 0029: 
 0030: 
 0031: # --------------- clm enums ---------------- #
+0032: cpdef enum Interp:
enum __pyx_t_8pysndlib_3clm_Interp {
  __pyx_e_8pysndlib_3clm_NONE,
  __pyx_e_8pysndlib_3clm_LINEAR,
  __pyx_e_8pysndlib_3clm_SINUSOIDAL,
  __pyx_e_8pysndlib_3clm_ALL_PASS,
  __pyx_e_8pysndlib_3clm_LAGRANGE,
  __pyx_e_8pysndlib_3clm_BEZIER,
  __pyx_e_8pysndlib_3clm_HERMITE
};
 0033:     """
 0034:     various interpolation types
 0035:     """
 0036:     NONE, LINEAR,SINUSOIDAL, ALL_PASS, LAGRANGE, BEZIER, HERMITE
 0037: 
+0038: cpdef enum Window:
enum __pyx_t_8pysndlib_3clm_Window {
  __pyx_e_8pysndlib_3clm_RECTANGULAR,
  __pyx_e_8pysndlib_3clm_HANN,
  __pyx_e_8pysndlib_3clm_WELCH,
  __pyx_e_8pysndlib_3clm_PARZEN,
  __pyx_e_8pysndlib_3clm_BARTLETT,
  __pyx_e_8pysndlib_3clm_HAMMING,
  __pyx_e_8pysndlib_3clm_BLACKMAN2,
  __pyx_e_8pysndlib_3clm_BLACKMAN3,
  __pyx_e_8pysndlib_3clm_BLACKMAN4,
  __pyx_e_8pysndlib_3clm_EXPONENTIAL,
  __pyx_e_8pysndlib_3clm_RIEMANN,
  __pyx_e_8pysndlib_3clm_KAISER,
  __pyx_e_8pysndlib_3clm_CAUCHY,
  __pyx_e_8pysndlib_3clm_POISSON,
  __pyx_e_8pysndlib_3clm_GAUSSIAN,
  __pyx_e_8pysndlib_3clm_TUKEY,
  __pyx_e_8pysndlib_3clm_DOLPH_CHEBYSHEV,
  __pyx_e_8pysndlib_3clm_HANN_POISSON,
  __pyx_e_8pysndlib_3clm_CONNES,
  __pyx_e_8pysndlib_3clm_SAMARAKI,
  __pyx_e_8pysndlib_3clm_ULTRASPHERICAL,
  __pyx_e_8pysndlib_3clm_BARTLETT_HANN,
  __pyx_e_8pysndlib_3clm_BOHMAN,
  __pyx_e_8pysndlib_3clm_FLAT_TOP,
  __pyx_e_8pysndlib_3clm_BLACKMAN5,
  __pyx_e_8pysndlib_3clm_BLACKMAN6,
  __pyx_e_8pysndlib_3clm_BLACKMAN7,
  __pyx_e_8pysndlib_3clm_BLACKMAN8,
  __pyx_e_8pysndlib_3clm_BLACKMAN9,
  __pyx_e_8pysndlib_3clm_BLACKMAN10,
  __pyx_e_8pysndlib_3clm_RV2,
  __pyx_e_8pysndlib_3clm_RV3,
  __pyx_e_8pysndlib_3clm_RV4,
  __pyx_e_8pysndlib_3clm_MLT_SINE,
  __pyx_e_8pysndlib_3clm_PAPOULIS,
  __pyx_e_8pysndlib_3clm_DPSS,
  __pyx_e_8pysndlib_3clm_SINC
};
 0039:     """
 0040:     many useful windows
 0041:     """
 0042:     RECTANGULAR, HANN, WELCH, PARZEN, BARTLETT, HAMMING, BLACKMAN2, BLACKMAN3, BLACKMAN4, EXPONENTIAL, RIEMANN, KAISER, CAUCHY, POISSON, GAUSSIAN, TUKEY, DOLPH_CHEBYSHEV, HANN_POISSON, CONNES, SAMARAKI, ULTRASPHERICAL, BARTLETT_HANN, BOHMAN, FLAT_TOP, BLACKMAN5, BLACKMAN6, BLACKMAN7, BLACKMAN8, BLACKMAN9, BLACKMAN10, RV2, RV3, RV4, MLT_SINE, PAPOULIS, DPSS, SINC,
 0043: 
+0044: cpdef enum Spectrum:
enum __pyx_t_8pysndlib_3clm_Spectrum {
  __pyx_e_8pysndlib_3clm_IN_DB,
  __pyx_e_8pysndlib_3clm_NORMALIZED,
  __pyx_e_8pysndlib_3clm_RAW
};
 0045:     """
 0046:     types of normalizations when using the spectrum function. The results are in dB if IN_DB, or linear and normalized to 1.0 NORMALIZED, or linear unnormalized RAW
 0047:     """
 0048:     IN_DB, NORMALIZED, RAW
 0049: 
+0050: cpdef enum Polynomial:
enum __pyx_t_8pysndlib_3clm_Polynomial {
  __pyx_e_8pysndlib_3clm_EITHER_KIND,
  __pyx_e_8pysndlib_3clm_FIRST_KIND,
  __pyx_e_8pysndlib_3clm_SECOND_KIND,
  __pyx_e_8pysndlib_3clm_BOTH_KINDS
};
 0051:     """
 0052:     used for polynomial based gens 
 0053:     """
 0054:     EITHER_KIND, FIRST_KIND, SECOND_KIND, BOTH_KINDS
 0055: 
 0056: 
 0057: 
 0058: # --------------- function types for ctypes ---------------- #
+0059: INPUTCALLBACK = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_void_p, ctypes.c_int)
  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_c_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_c_int); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __pyx_t_43 = PyTuple_New(3); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_42);
  PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_42);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_43, 2, __pyx_t_40);
  __pyx_t_10 = 0;
  __pyx_t_42 = 0;
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_t_43, NULL); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INPUTCALLBACK, __pyx_t_40) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
+0060: EDITCALLBACK = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p)
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_c_int); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = PyTuple_New(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_41);
  __Pyx_GIVEREF(__pyx_t_42);
  PyTuple_SET_ITEM(__pyx_t_40, 1, __pyx_t_42);
  __pyx_t_41 = 0;
  __pyx_t_42 = 0;
  __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_43, __pyx_t_40, NULL); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EDITCALLBACK, __pyx_t_42) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
+0061: ANALYZECALLBACK = ctypes.CFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_void_p, ctypes.c_int))
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_c_bool); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_39 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_c_double); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_c_int); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_42 = PyTuple_New(3); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_GIVEREF(__pyx_t_39);
  PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_t_39);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_42, 1, __pyx_t_38);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_42, 2, __pyx_t_37);
  __pyx_t_39 = 0;
  __pyx_t_38 = 0;
  __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_42, NULL); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_42 = PyTuple_New(3); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_GIVEREF(__pyx_t_43);
  PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_t_43);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_42, 1, __pyx_t_41);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_42, 2, __pyx_t_37);
  __pyx_t_43 = 0;
  __pyx_t_41 = 0;
  __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_Call(__pyx_t_40, __pyx_t_42, NULL); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANALYZECALLBACK, __pyx_t_37) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
+0062: SYNTHESIZECALLBACK = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_void_p)
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_c_double); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = PyTuple_New(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_40);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_37, 1, __pyx_t_41);
  __pyx_t_40 = 0;
  __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_t_37, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNTHESIZECALLBACK, __pyx_t_41) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0063: LOCSIGDETOURCALLBACK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_longlong)
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_c_longlong); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = PyTuple_New(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 0, Py_None);
  __Pyx_GIVEREF(__pyx_t_42);
  PyTuple_SET_ITEM(__pyx_t_41, 1, __pyx_t_42);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_41, 2, __pyx_t_40);
  __pyx_t_42 = 0;
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_41, NULL); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOCSIGDETOURCALLBACK, __pyx_t_40) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
+0064: ENVFUNCTION = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double) # for env_any    
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_CFUNCTYPE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_c_double); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_c_double); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = PyTuple_New(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_37);
  __Pyx_GIVEREF(__pyx_t_42);
  PyTuple_SET_ITEM(__pyx_t_40, 1, __pyx_t_42);
  __pyx_t_37 = 0;
  __pyx_t_42 = 0;
  __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_t_40, NULL); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ENVFUNCTION, __pyx_t_42) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
 0065: 
 0066: #these may need to be set based on system type etc
+0067: DEFAULT_OUTPUT_SRATE = 44100
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_OUTPUT_SRATE, __pyx_int_44100) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
+0068: DEFAULT_OUTPUT_CHANS = 1
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_OUTPUT_CHANS, __pyx_int_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+0069: DEFAULT_OUTPUT_SAMPLE_TYPE = Sample.BFLOAT
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_Sample); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_BFLOAT); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_OUTPUT_SAMPLE_TYPE, __pyx_t_40) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
+0070: DEFAULT_OUTPUT_HEADER_TYPE = Header.AIFC
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_Header); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_AIFC); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_OUTPUT_HEADER_TYPE, __pyx_t_42) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
 0071: 
+0072: DEFAULT_FILE_PLAYER = None
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_FILE_PLAYER, Py_None) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
 0073: 
+0074: if sys.platform.startswith("darwin"):
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_sys); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_platform); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_startswith); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_42, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_40); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (__pyx_t_2) {
/* … */
  }
/* … */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_darwin); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
+0075:     DEFAULT_FILE_PLAYER = 'afplay'
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_FILE_PLAYER, __pyx_n_s_afplay) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
+0076:     DEFAULT_FILE_NAME = 'test.aiff'
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_FILE_NAME, __pyx_kp_s_test_aiff) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
 0077: 
+0078: if sys.platform.startswith("linux"):
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_sys); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_platform); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_startswith); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_40, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_42); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  if (__pyx_t_2) {
/* … */
  }
/* … */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_n_s_linux); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
+0079:     DEFAULT_FILE_PLAYER = 'aplay'
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_FILE_PLAYER, __pyx_n_s_aplay) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
+0080:     DEFAULT_FILE_NAME = 'test.wav'
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_FILE_NAME, __pyx_kp_s_test_wav) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
 0081: 
 0082: 
 0083: # --------------- main clm prefs ---------------- #
 0084: 
+0085: CLM  = types.SimpleNamespace(
  __Pyx_GetModuleGlobalName(__pyx_t_42, __pyx_n_s_types); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_SimpleNamespace); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
/* … */
  __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_40, __pyx_empty_tuple, __pyx_t_42); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLM, __pyx_t_41) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0086:     file_name = DEFAULT_FILE_NAME,
  __pyx_t_42 = __Pyx_PyDict_NewPresized(20); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_DEFAULT_FILE_NAME); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_file_name, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0087:     srate = DEFAULT_OUTPUT_SRATE,
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_DEFAULT_OUTPUT_SRATE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_srate, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0088:     channels = DEFAULT_OUTPUT_CHANS,
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_DEFAULT_OUTPUT_CHANS); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_channels, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0089:     sample_type = DEFAULT_OUTPUT_SAMPLE_TYPE,
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_DEFAULT_OUTPUT_SAMPLE_TYPE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_sample_type, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0090:     header_type = DEFAULT_OUTPUT_HEADER_TYPE,
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_DEFAULT_OUTPUT_HEADER_TYPE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_header_type, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0091:     player = DEFAULT_FILE_PLAYER,
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_DEFAULT_FILE_PLAYER); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_player, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0092:     verbose = False,
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_verbose, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+0093:     play = False,
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_play, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+0094:     statistics = False,
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_statistics, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+0095:     reverb = None,
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_reverb, Py_None) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_reverb_channels, __pyx_int_1) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
 0096:     reverb_channels = 1,
+0097:     reverb_data = None,
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_reverb_data, Py_None) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_reverb_file_name, __pyx_kp_s_test_rev) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_table_size, __pyx_int_512) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_buffer_size, __pyx_int_65536) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
 0098:     reverb_file_name = 'test.rev',
 0099:     table_size = 512,
 0100:     buffer_size = 65536,
+0101:     locsig_type = Interp.LINEAR,
  __pyx_t_41 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_locsig_type, __pyx_t_41) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
+0102:     clipped = True,
  if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_clipped, Py_True) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+0103:     player = False,
  if (unlikely(PyDict_Contains(__pyx_t_42, __pyx_n_s_player))) {
    __Pyx_RaiseDoubleKeywordsError("function", __pyx_n_s_player); __PYX_ERR(0, 103, __pyx_L1_error)
  } else {
    if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_player, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  }
+0104:     output = False,
  if (unlikely(PyDict_Contains(__pyx_t_42, __pyx_n_s_output))) {
    __Pyx_RaiseDoubleKeywordsError("function", __pyx_n_s_output); __PYX_ERR(0, 104, __pyx_L1_error)
  } else {
    if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_output, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  }
+0105:     delete_reverb = False
  if (unlikely(PyDict_Contains(__pyx_t_42, __pyx_n_s_delete_reverb))) {
    __Pyx_RaiseDoubleKeywordsError("function", __pyx_n_s_delete_reverb); __PYX_ERR(0, 105, __pyx_L1_error)
  } else {
    if (PyDict_SetItem(__pyx_t_42, __pyx_n_s_delete_reverb, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  }
 0106: )
 0107: 
 0108: 
 0109: 
 0110: 
 0111: # --------------- initializations ---------------- #
 0112: 
+0113: cclm.mus_initialize()
  mus_initialize();
+0114: cclm.mus_set_rand_seed(int(time.time()))
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_time); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_time); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallNoArg(__pyx_t_42); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_42 = __Pyx_PyNumber_Int(__pyx_t_41); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_45 = __Pyx_PyInt_As_uint64_t(__pyx_t_42); if (unlikely((__pyx_t_45 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  mus_set_rand_seed(__pyx_t_45);
 0115: 
 0116: 
+0117: cdef void clm_error_handler(int error_type, char* msg):
static void __pyx_f_8pysndlib_3clm_clm_error_handler(int __pyx_v_error_type, char *__pyx_v_msg) {
  PyObject *__pyx_v_message = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_error_handler", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.clm_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_RefNannyFinishContext();
}
+0118:     message =  msg + ". "  +  csndlib.mus_error_type_to_string(error_type)
  __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_s__13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_FromString(mus_error_type_to_string(__pyx_v_error_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_message = __pyx_t_3;
  __pyx_t_3 = 0;
+0119:     raise SNDLibError(message)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SNDLibError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_message};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 119, __pyx_L1_error)
 0120: 
+0121: class SNDLibError(Exception):
  __pyx_t_42 = PyTuple_New(1); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
  __Pyx_INCREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  __Pyx_GIVEREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  PyTuple_SET_ITEM(__pyx_t_42, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_41 = __Pyx_PEP560_update_bases(__pyx_t_42); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_CalculateMetaclass(NULL, __pyx_t_41); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_Py3MetaclassPrepare(__pyx_t_40, __pyx_t_41, __pyx_n_s_SNDLibError, __pyx_n_s_SNDLibError, (PyObject *) NULL, __pyx_n_s_pysndlib_clm, __pyx_kp_s_this_is_general_class_to_raise); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (__pyx_t_41 != __pyx_t_42) {
    if (unlikely((PyDict_SetItemString(__pyx_t_37, "__orig_bases__", __pyx_t_42) < 0))) __PYX_ERR(0, 121, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  __pyx_t_42 = PyList_New(0); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_42);
/* … */
  __pyx_t_43 = __Pyx_Py3ClassCreate(__pyx_t_40, __pyx_n_s_SNDLibError, __pyx_t_41, __pyx_t_37, NULL, 0, 0); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_42, __pyx_t_43) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNDLibError, __pyx_t_43) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
 0122:     """
 0123:     this is general class to raise an print errors as defined in sndlib. it is to be used internally by the defined error handler registered with sndlib
 0124:     
 0125:     :meta private:
 0126:     """
 0127: 
+0128:     def ___init___(self, message):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_11SNDLibError_1___init___(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_11SNDLibError_1___init___ = {"___init___", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_11SNDLibError_1___init___, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_11SNDLibError_1___init___(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_message = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("___init___ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_message)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("___init___", 1, 2, 2, 1); __PYX_ERR(0, 128, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "___init___") < 0)) __PYX_ERR(0, 128, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("___init___", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.SNDLibError.___init___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_11SNDLibError____init___(__pyx_self, __pyx_v_self, __pyx_v_message);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_11SNDLibError____init___(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_message) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("___init___", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.SNDLibError.___init___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__99 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
/* … */
  __pyx_t_43 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_11SNDLibError_1___init___, 0, __pyx_n_s_SNDLibError____init, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_INCREF(__pyx_t_43);
  PyList_Append(__pyx_t_42, __pyx_t_43);
  __Pyx_GIVEREF(__pyx_t_43);
  if (__Pyx_SetNameInClass(__pyx_t_37, __pyx_n_s_init_2, __pyx_t_43) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_init_2, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 128, __pyx_L1_error)
+0129:         super().__init__(self.message)
  __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 129, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0130: 
 0131: 
 0132: 
+0133: def check_ndim(arr: npt.NDArray[np.float64], dim=1):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_1check_ndim(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_1check_ndim = {"check_ndim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_1check_ndim, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_1check_ndim(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_dim = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_ndim (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_dim,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dim);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_ndim") < 0)) __PYX_ERR(0, 133, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = values[0];
    __pyx_v_dim = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_ndim", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 133, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.check_ndim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_check_ndim(__pyx_self, __pyx_v_arr, __pyx_v_dim);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_check_ndim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_dim) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_ndim", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.check_ndim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__101 = PyTuple_Pack(2, __pyx_n_s_arr, __pyx_n_s_dim); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_check_ndim, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 133, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_arr, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_1check_ndim, 0, __pyx_n_s_check_ndim, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__103);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_ndim, __pyx_t_40) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__103 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
+0134:     if arr.ndim != dim:
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dim, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {
/* … */
  }
+0135:         raise TypeError(f'expecting {dim} dimemsions but received {arr.ndim}.')
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_expecting);
    __pyx_t_4 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_expecting);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_expecting);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_dim, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_dimemsions_but_received);
    __pyx_t_4 += 25;
    __Pyx_GIVEREF(__pyx_kp_u_dimemsions_but_received);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_dimemsions_but_received);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__3);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__3);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__3);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 135, __pyx_L1_error)
 0136: 
+0137: def check_range(arg: str, x, low=None, high=None):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_3check_range(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_3check_range = {"check_range", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_3check_range, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_3check_range(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_low = 0;
  PyObject *__pyx_v_high = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_range (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arg,&__pyx_n_s_x,&__pyx_n_s_low,&__pyx_n_s_high,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arg)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("check_range", 0, 2, 4, 1); __PYX_ERR(0, 137, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_low);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_high);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_range") < 0)) __PYX_ERR(0, 137, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arg = ((PyObject*)values[0]);
    __pyx_v_x = values[1];
    __pyx_v_low = values[2];
    __pyx_v_high = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_range", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 137, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.check_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arg), (&PyString_Type), 0, "arg", 1))) __PYX_ERR(0, 137, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_2check_range(__pyx_self, __pyx_v_arg, __pyx_v_x, __pyx_v_low, __pyx_v_high);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_2check_range(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arg, PyObject *__pyx_v_x, PyObject *__pyx_v_low, PyObject *__pyx_v_high) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_range", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.check_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__104 = PyTuple_Pack(4, __pyx_n_s_arg, __pyx_n_s_x, __pyx_n_s_low, __pyx_n_s_high); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_check_range, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 137, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_arg, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_3check_range, 0, __pyx_n_s_check_range, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__106);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_range, __pyx_t_41) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__106 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
+0138:     if x is None:
  __pyx_t_1 = (__pyx_v_x == Py_None);
  if (__pyx_t_1) {
/* … */
  }
+0139:         return
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
+0140:     if low is not None:
  __pyx_t_1 = (__pyx_v_low != Py_None);
  if (__pyx_t_1) {
/* … */
  }
+0141:         if x < low:
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_v_low, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 141, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_1)) {
/* … */
    }
+0142:             raise ValueError(f'{arg} is out of range. {x} < {low}')
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = 127;
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_arg, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_out_of_range);
      __pyx_t_3 += 18;
      __Pyx_GIVEREF(__pyx_kp_u_is_out_of_range);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_is_out_of_range);
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_x, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__14);
      __pyx_t_3 += 3;
      __Pyx_GIVEREF(__pyx_kp_u__14);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__14);
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_low, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 142, __pyx_L1_error)
+0143:     if high is not None:
  __pyx_t_1 = (__pyx_v_high != Py_None);
  if (__pyx_t_1) {
/* … */
  }
+0144:         if x > high:
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_v_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_1)) {
/* … */
    }
+0145:             raise ValueError(f'{arg} is out of range. {x} > {high}')
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = 127;
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_arg, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_out_of_range);
      __pyx_t_3 += 18;
      __Pyx_GIVEREF(__pyx_kp_u_is_out_of_range);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_is_out_of_range);
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_x, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__15);
      __pyx_t_3 += 3;
      __Pyx_GIVEREF(__pyx_kp_u__15);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__15);
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_high, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 145, __pyx_L1_error)
 0146: 
 0147: 
+0148: def compare_shapes(arr1: npt.NDArray[np.float64], arr2: npt.NDArray[np.float64]):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_5compare_shapes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_5compare_shapes = {"compare_shapes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_5compare_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_5compare_shapes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_arr1 = 0;
  PyObject *__pyx_v_arr2 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compare_shapes (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr1,&__pyx_n_s_arr2,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("compare_shapes", 1, 2, 2, 1); __PYX_ERR(0, 148, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compare_shapes") < 0)) __PYX_ERR(0, 148, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_arr1 = values[0];
    __pyx_v_arr2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compare_shapes", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 148, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.compare_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_4compare_shapes(__pyx_self, __pyx_v_arr1, __pyx_v_arr2);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_4compare_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr1, PyObject *__pyx_v_arr2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compare_shapes", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.compare_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_arr1, __pyx_n_s_arr2); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_arr1, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_arr2, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_5compare_shapes, 0, __pyx_n_s_compare_shapes, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compare_shapes, __pyx_t_40) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_compare_shapes, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 148, __pyx_L1_error)
+0149:     if arr1.shape != arr2.shape:
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr1, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr2, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {
/* … */
  }
+0150:         raise RuntimeError(f'ndarrays of unequal shape {arr1.shape } vs. {arr2.shape }.')
    __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_ndarrays_of_unequal_shape);
    __pyx_t_5 += 26;
    __Pyx_GIVEREF(__pyx_kp_u_ndarrays_of_unequal_shape);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_ndarrays_of_unequal_shape);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_vs);
    __pyx_t_5 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_vs);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_vs);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr2, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__3);
    __pyx_t_5 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__3);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__3);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 150, __pyx_L1_error)
 0151: 
+0152: csndlib.mus_error_set_handler(<csndlib.mus_error_handler_t *>clm_error_handler)
  (void)(mus_error_set_handler(((mus_error_handler_t *)__pyx_f_8pysndlib_3clm_clm_error_handler)));
 0153: 
 0154: 
+0155: cdef bint is_simple_filter(gen: mus_any):
static int __pyx_f_8pysndlib_3clm_is_simple_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_simple_filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0156:     return cclm.mus_is_one_zero(gen._ptr) or cclm.mus_is_one_pole(gen._ptr) or cclm.mus_is_two_zero(gen._ptr) or cclm.mus_is_two_pole(gen._ptr)
  __pyx_t_2 = mus_is_one_zero(__pyx_v_gen->_ptr);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = mus_is_one_pole(__pyx_v_gen->_ptr);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = mus_is_two_zero(__pyx_v_gen->_ptr);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = mus_is_two_pole(__pyx_v_gen->_ptr);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;
 0157: 
 0158: 
 0159: 
 0160: # todo add mus_set_xcoeff and mus_set_ycoeff
 0161: 
 0162: # --------------- extension types ---------------- #
 0163: 
+0164: cdef class mus_any:
struct __pyx_obj_8pysndlib_3clm_mus_any {
  PyObject_HEAD
  struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *__pyx_vtab;
  mus_any *_ptr;
  int ptr_owner;
  input_cb _inputcallback;
  edit_cb _editcallback;
  analyze_cb _analyzecallback;
  synthesize_cb _synthesizecallback;
  PyObject *_cache;
  mus_float_t *_data_ptr;
  PyArrayObject *_data;
  mus_float_t *_xcoeffs_ptr;
  PyArrayObject *_xcoeffs;
  mus_float_t *_ycoeffs_ptr;
  PyArrayObject *_ycoeffs;
  mus_float_t *_pv_amp_increments_ptr;
  PyArrayObject *_pv_amp_increments;
  mus_float_t *_pv_amps_ptr;
  PyArrayObject *_pv_amps;
  mus_float_t *_pv_freqs_ptr;
  PyArrayObject *_pv_freqs;
  mus_float_t *_pv_phases_ptr;
  PyArrayObject *_pv_phases;
  mus_float_t *_pv_phase_increments_ptr;
  PyArrayObject *_pv_phase_increments;
};
/* … */
struct __pyx_vtabstruct_8pysndlib_3clm_mus_any {
  struct __pyx_obj_8pysndlib_3clm_mus_any *(*from_ptr)(mus_any *, struct __pyx_opt_args_8pysndlib_3clm_7mus_any_from_ptr *__pyx_optional_args);
  PyObject *(*cache_append)(struct __pyx_obj_8pysndlib_3clm_mus_any *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*cache_extend)(struct __pyx_obj_8pysndlib_3clm_mus_any *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*set_up_data)(struct __pyx_obj_8pysndlib_3clm_mus_any *, int __pyx_skip_dispatch);
  PyObject *(*set_up_xcoeffs)(struct __pyx_obj_8pysndlib_3clm_mus_any *, int __pyx_skip_dispatch);
  PyObject *(*set_up_ycoeffs)(struct __pyx_obj_8pysndlib_3clm_mus_any *, int __pyx_skip_dispatch);
  PyObject *(*set_up_pv_data)(struct __pyx_obj_8pysndlib_3clm_mus_any *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *__pyx_vtabptr_8pysndlib_3clm_mus_any;

 0165:     """
 0166:     a wrapper class for mus_any pointers in c
 0167:     
 0168:     instances of this class have the following properties, which may be 
 0169:     used if supported by the type of generator used to make the instance:
 0170:     
 0171:     
 0172:     """
 0173: 
 0174:     cdef cclm.mus_any *_ptr
 0175:     cdef bint ptr_owner
 0176:     cdef cclm.input_cb _inputcallback
 0177:     cdef cclm.edit_cb _editcallback
 0178:     cdef cclm.analyze_cb _analyzecallback
 0179:     cdef cclm.synthesize_cb _synthesizecallback
 0180:     cdef list _cache
 0181:     cdef cclm.mus_float_t* _data_ptr
 0182:     cdef np.ndarray _data
 0183:     cdef cclm.mus_float_t* _xcoeffs_ptr
 0184:     cdef np.ndarray _xcoeffs
 0185:     cdef cclm.mus_float_t* _ycoeffs_ptr
 0186:     cdef np.ndarray _ycoeffs
 0187:     cdef cclm.mus_float_t* _pv_amp_increments_ptr
 0188:     cdef np.ndarray _pv_amp_increments
 0189:     cdef cclm.mus_float_t* _pv_amps_ptr
 0190:     cdef np.ndarray _pv_amps
 0191:     cdef cclm.mus_float_t* _pv_freqs_ptr
 0192:     cdef np.ndarray _pv_freqs
 0193:     cdef cclm.mus_float_t* _pv_phases_ptr
 0194:     cdef np.ndarray _pv_phases
 0195:     cdef cclm.mus_float_t* _pv_phase_increments_ptr
 0196:     cdef np.ndarray _pv_phase_increments
 0197: 
+0198:     def __cinit__(self):
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any___cinit__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any___cinit__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0199:         self.ptr_owner = False
  __pyx_v_self->ptr_owner = 0;
+0200:         self._cache = []
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_cache);
  __Pyx_DECREF(__pyx_v_self->_cache);
  __pyx_v_self->_cache = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
+0201:         self._inputcallback = NULL
  __pyx_v_self->_inputcallback = NULL;
+0202:         self._editcallback = NULL
  __pyx_v_self->_editcallback = NULL;
+0203:         self._analyzecallback = NULL
  __pyx_v_self->_analyzecallback = NULL;
+0204:         self._synthesizecallback = NULL
  __pyx_v_self->_synthesizecallback = NULL;
+0205:         self._cache = []
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_cache);
  __Pyx_DECREF(__pyx_v_self->_cache);
  __pyx_v_self->_cache = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
 0206: 
 0207: 
+0208:     def __delalloc__(self):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_3__delalloc__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_3__delalloc__ = {"__delalloc__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_3__delalloc__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_3__delalloc__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__delalloc__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__delalloc__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__delalloc__", 0))) return NULL;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_2__delalloc__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_2__delalloc__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__delalloc__", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_3__delalloc__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any___delalloc, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_delalloc, __pyx_t_40) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
/* … */
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_delalloc, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 208, __pyx_L1_error)
+0209:         if self._ptr is not NULL and self.ptr_owner is True:
  __pyx_t_2 = (__pyx_v_self->_ptr != NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->ptr_owner == 1);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {
/* … */
  }
+0210:             cclm.mus_free(self._ptr)
    mus_free(__pyx_v_self->_ptr);
+0211:             self._ptr = NULL
    __pyx_v_self->_ptr = NULL;
 0212: 
 0213: 
+0214:     def __init__(self):
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_4__init__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_4__init__(CYTHON_UNUSED struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0215:         # prevent accidental instantiation from normal python code
 0216:         # since we cannot pass a struct pointer into a python constructor.
+0217:         raise TypeError("this class cannot be instantiated directly.")
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 217, __pyx_L1_error)
/* … */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_this_class_cannot_be_instantiate); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
 0218: 
 0219:     @staticmethod
+0220:     cdef mus_any from_ptr(cclm.mus_any *_ptr, bint owner=True):
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_7mus_any_from_ptr(mus_any *__pyx_v__ptr, struct __pyx_opt_args_8pysndlib_3clm_7mus_any_from_ptr *__pyx_optional_args) {
  int __pyx_v_owner = ((int)1);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_wrapper = 0;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_ptr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_owner = __pyx_optional_args->owner;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_wrapper);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
struct __pyx_opt_args_8pysndlib_3clm_7mus_any_from_ptr {
  int __pyx_n;
  int owner;
};
 0221:         """
 0222:         factory function to create mus_any objects from
 0223:         given mus_any pointer.
 0224: 
 0225:         setting ``owner`` flag to ``True`` causes
 0226:         the extension type to ``free`` the structure pointed to by ``_ptr``
 0227:         when the wrapper object is deallocated.
 0228: 
 0229:         :meta private:
 0230:         """
 0231:         # fast call to __new__() that bypasses the __init__() constructor.
+0232:         cdef mus_any wrapper = mus_any.__new__(mus_any)
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_8pysndlib_3clm_mus_any(((PyTypeObject *)__pyx_ptype_8pysndlib_3clm_mus_any), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_wrapper = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
+0233:         wrapper._ptr = _ptr
  __pyx_v_wrapper->_ptr = __pyx_v__ptr;
+0234:         wrapper.ptr_owner = owner
  __pyx_v_wrapper->ptr_owner = __pyx_v_owner;
+0235:         if cclm.mus_data_exists(wrapper._ptr):
  __pyx_t_2 = mus_data_exists(__pyx_v_wrapper->_ptr);
  if (__pyx_t_2) {
/* … */
  }
+0236:             wrapper.set_up_data()
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_wrapper->__pyx_vtab)->set_up_data(__pyx_v_wrapper, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0237:         if cclm.mus_xcoeffs_exists(wrapper._ptr):
  __pyx_t_2 = mus_xcoeffs_exists(__pyx_v_wrapper->_ptr);
  if (__pyx_t_2) {
/* … */
  }
+0238:             wrapper.set_up_xcoeffs()
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_wrapper->__pyx_vtab)->set_up_xcoeffs(__pyx_v_wrapper, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0239:         if cclm.mus_ycoeffs_exists(wrapper._ptr):
  __pyx_t_2 = mus_ycoeffs_exists(__pyx_v_wrapper->_ptr);
  if (__pyx_t_2) {
/* … */
  }
+0240:             wrapper.set_up_ycoeffs()
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_wrapper->__pyx_vtab)->set_up_ycoeffs(__pyx_v_wrapper, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0241:         if is_phase_vocoder(wrapper):
  __pyx_t_2 = __pyx_f_8pysndlib_3clm_is_phase_vocoder(__pyx_v_wrapper, 0); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
  if (__pyx_t_2) {
/* … */
  }
+0242:             wrapper.set_up_pv_data()
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_wrapper->__pyx_vtab)->set_up_pv_data(__pyx_v_wrapper, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0243: 
+0244:         return wrapper
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_wrapper);
  __pyx_r = __pyx_v_wrapper;
  goto __pyx_L0;
 0245: 
+0246:     cpdef cache_append(self, obj):
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_7cache_append(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_7mus_any_cache_append(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cache_append", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cache_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_8pysndlib_3clm_7mus_any_7cache_append)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_obj};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.cache_append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_7cache_append(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_7mus_any_6cache_append, "\n        :meta private:\n        ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_7cache_append = {"cache_append", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_7cache_append, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_7mus_any_6cache_append};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_7cache_append(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_obj = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cache_append (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cache_append") < 0)) __PYX_ERR(0, 246, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cache_append", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 246, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.cache_append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_6cache_append(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), __pyx_v_obj);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_6cache_append(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cache_append", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_7mus_any_cache_append(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.cache_append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_7cache_append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any_cache_append, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_cache_append, __pyx_t_40) < 0) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_cache_append, 246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 246, __pyx_L1_error)
 0247:         """
 0248:         :meta private:
 0249:         """
+0250:         self._cache.append(obj)
  if (unlikely(__pyx_v_self->_cache == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->_cache, __pyx_v_obj); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 250, __pyx_L1_error)
 0251: 
+0252:     cpdef cache_extend(self, obj):
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9cache_extend(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_7mus_any_cache_extend(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cache_extend", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cache_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_8pysndlib_3clm_7mus_any_9cache_extend)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_obj};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.cache_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9cache_extend(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_7mus_any_8cache_extend, "\n        :meta private:\n        ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_9cache_extend = {"cache_extend", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_9cache_extend, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_7mus_any_8cache_extend};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9cache_extend(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_obj = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cache_extend (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cache_extend") < 0)) __PYX_ERR(0, 252, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cache_extend", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 252, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.cache_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_8cache_extend(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), __pyx_v_obj);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_8cache_extend(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cache_extend", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_7mus_any_cache_extend(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.cache_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_9cache_extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any_cache_extend, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_cache_extend, __pyx_t_40) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
/* … */
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_cache_extend, 252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 252, __pyx_L1_error)
 0253:         """
 0254:         :meta private:
 0255:         """
+0256:         self._cache.extend(obj)
  if (unlikely(__pyx_v_self->_cache == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
    __PYX_ERR(0, 256, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyList_Extend(__pyx_v_self->_cache, __pyx_v_obj); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 256, __pyx_L1_error)
 0257: 
 0258:     # this stuff with view.array is to work around an apparent bug when automatic string handling is turned on
 0259:     # https://github.com/cython/cython/issues/4521        
+0260:     cpdef set_up_data(self):
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11set_up_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_7mus_any_set_up_data(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_array_obj *__pyx_v_arr = 0;
  mus_long_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_data", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_up_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_8pysndlib_3clm_7mus_any_11set_up_data)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_4, };
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11set_up_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_7mus_any_10set_up_data, "\n        :meta private:\n        ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_11set_up_data = {"set_up_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_11set_up_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_7mus_any_10set_up_data};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11set_up_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_data (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("set_up_data", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_up_data", 0))) return NULL;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10set_up_data(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_10set_up_data(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_7mus_any_set_up_data(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_11set_up_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any_set_up_data, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_set_up_data, __pyx_t_40) < 0) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
/* … */
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_set_up_data, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 260, __pyx_L1_error)
 0261:         """
 0262:         :meta private:
 0263:         """
+0264:         cdef view.array arr = None
  __Pyx_INCREF(Py_None);
  __pyx_v_arr = ((struct __pyx_array_obj *)Py_None);
+0265:         cdef cclm.mus_long_t size = cclm.mus_length(self._ptr)
  __pyx_v_size = mus_length(__pyx_v_self->_ptr);
+0266:         if size > 0:
  __pyx_t_6 = (__pyx_v_size > 0);
  if (__pyx_t_6) {
/* … */
    goto __pyx_L3;
  }
+0267:             self._data_ptr = cclm.mus_data(self._ptr)
    __pyx_v_self->_data_ptr = mus_data(__pyx_v_self->_ptr);
+0268:             arr = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=False)
    __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemsize, __pyx_t_3) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, ((struct __pyx_array_obj *)__pyx_t_3));
    __pyx_t_3 = 0;
+0269:             arr.data = <char*>self._data_ptr
    __pyx_v_arr->data = ((char *)__pyx_v_self->_data_ptr);
+0270:             self._data = np.asarray(arr)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_arr)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_data);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_data);
    __pyx_v_self->_data = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
 0271:         else:
+0272:             self._data = None
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_data);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_data);
    __pyx_v_self->_data = ((PyArrayObject *)Py_None);
  }
  __pyx_L3:;
 0273: 
+0274:     cpdef set_up_xcoeffs(self):
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13set_up_xcoeffs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_7mus_any_set_up_xcoeffs(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, int __pyx_skip_dispatch) {
  mus_long_t __pyx_v_size;
  struct __pyx_array_obj *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_xcoeffs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_up_xcoeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_8pysndlib_3clm_7mus_any_13set_up_xcoeffs)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_4, };
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_xcoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13set_up_xcoeffs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_7mus_any_12set_up_xcoeffs, "\n        :meta private:\n        ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_13set_up_xcoeffs = {"set_up_xcoeffs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_13set_up_xcoeffs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_7mus_any_12set_up_xcoeffs};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13set_up_xcoeffs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_xcoeffs (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("set_up_xcoeffs", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_up_xcoeffs", 0))) return NULL;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_12set_up_xcoeffs(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_12set_up_xcoeffs(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_xcoeffs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_7mus_any_set_up_xcoeffs(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_xcoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_13set_up_xcoeffs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any_set_up_xcoeffs, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_set_up_xcoeffs, __pyx_t_40) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
/* … */
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_set_up_xcoeffs, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 274, __pyx_L1_error)
 0275:         """
 0276:         :meta private:
 0277:         """
+0278:         cdef cclm.mus_long_t size = 0
  __pyx_v_size = 0;
+0279:         cdef view.array arr = None
  __Pyx_INCREF(Py_None);
  __pyx_v_arr = ((struct __pyx_array_obj *)Py_None);
 0280:         #if simple filter the size will always be 3 and we do not want to
 0281:         #allocate a buffer
 0282:         # in other cases mus_order will be size and we do want to allocate
 0283: 
+0284:         if is_simple_filter(self):
  __pyx_t_6 = __pyx_f_8pysndlib_3clm_is_simple_filter(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error)
  if (__pyx_t_6) {
/* … */
    goto __pyx_L3;
  }
+0285:             size = 3
    __pyx_v_size = 3;
+0286:             self._xcoeffs_ptr = cclm.mus_xcoeffs(self._ptr)
    __pyx_v_self->_xcoeffs_ptr = mus_xcoeffs(__pyx_v_self->_ptr);
+0287:             arr = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=False)
    __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemsize, __pyx_t_3) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, ((struct __pyx_array_obj *)__pyx_t_3));
    __pyx_t_3 = 0;
+0288:             arr.data = <char*>self._xcoeffs_ptr
    __pyx_v_arr->data = ((char *)__pyx_v_self->_xcoeffs_ptr);
+0289:             self._xcoeffs = np.asarray(arr)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_arr)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_xcoeffs);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_xcoeffs);
    __pyx_v_self->_xcoeffs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
 0290:         else:
+0291:             size = cclm.mus_order(self._ptr)
  /*else*/ {
    __pyx_v_size = mus_order(__pyx_v_self->_ptr);
+0292:             self._xcoeffs_ptr = cclm.mus_xcoeffs(self._ptr)
    __pyx_v_self->_xcoeffs_ptr = mus_xcoeffs(__pyx_v_self->_ptr);
+0293:             arr = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=True)
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_itemsize, __pyx_t_1) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, ((struct __pyx_array_obj *)__pyx_t_1));
    __pyx_t_1 = 0;
+0294:             arr.data = <char*>self._xcoeffs_ptr
    __pyx_v_arr->data = ((char *)__pyx_v_self->_xcoeffs_ptr);
+0295:             self._xcoeffs = np.asarray(arr)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_arr)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_xcoeffs);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_xcoeffs);
    __pyx_v_self->_xcoeffs = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;
 0296: 
+0297:     cpdef set_up_ycoeffs(self):
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15set_up_ycoeffs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_7mus_any_set_up_ycoeffs(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, int __pyx_skip_dispatch) {
  mus_long_t __pyx_v_size;
  struct __pyx_array_obj *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_ycoeffs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_up_ycoeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_8pysndlib_3clm_7mus_any_15set_up_ycoeffs)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_4, };
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_ycoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15set_up_ycoeffs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_7mus_any_14set_up_ycoeffs, "\n        :meta private:\n        ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_15set_up_ycoeffs = {"set_up_ycoeffs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_15set_up_ycoeffs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_7mus_any_14set_up_ycoeffs};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15set_up_ycoeffs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_ycoeffs (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("set_up_ycoeffs", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_up_ycoeffs", 0))) return NULL;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_14set_up_ycoeffs(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_14set_up_ycoeffs(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_ycoeffs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_7mus_any_set_up_ycoeffs(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_ycoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_15set_up_ycoeffs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any_set_up_ycoeffs, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_set_up_ycoeffs, __pyx_t_40) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
/* … */
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_set_up_ycoeffs, 297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 297, __pyx_L1_error)
 0298:         """
 0299:         :meta private:
 0300:         """
+0301:         cdef cclm.mus_long_t size = 0
  __pyx_v_size = 0;
+0302:         cdef view.array arr = None
  __Pyx_INCREF(Py_None);
  __pyx_v_arr = ((struct __pyx_array_obj *)Py_None);
 0303:         #if simple filter the size will always be 3 and we do not want to
 0304:         #allocate a buffer
 0305:         # in other cases mus_order will be size and we do want to allocate
 0306: 
+0307:         if is_simple_filter(self):
  __pyx_t_6 = __pyx_f_8pysndlib_3clm_is_simple_filter(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
  if (__pyx_t_6) {
/* … */
    goto __pyx_L3;
  }
+0308:             size = 3
    __pyx_v_size = 3;
+0309:             self._xcoeffs_ptr = cclm.mus_xcoeffs(self._ptr)
    __pyx_v_self->_xcoeffs_ptr = mus_xcoeffs(__pyx_v_self->_ptr);
+0310:             arr = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=False)
    __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemsize, __pyx_t_3) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, ((struct __pyx_array_obj *)__pyx_t_3));
    __pyx_t_3 = 0;
+0311:             arr.data = <char*>self._ycoeffs_ptr
    __pyx_v_arr->data = ((char *)__pyx_v_self->_ycoeffs_ptr);
+0312:             self._xcoeffs = np.asarray(arr)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_arr)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 312, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_xcoeffs);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_xcoeffs);
    __pyx_v_self->_xcoeffs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
 0313:         else:
+0314:             size = cclm.mus_order(self._ptr)
  /*else*/ {
    __pyx_v_size = mus_order(__pyx_v_self->_ptr);
+0315:             self._xcoeffs_ptr = cclm.mus_xcoeffs(self._ptr)
    __pyx_v_self->_xcoeffs_ptr = mus_xcoeffs(__pyx_v_self->_ptr);
+0316:             arr = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=True)
    __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_itemsize, __pyx_t_1) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, ((struct __pyx_array_obj *)__pyx_t_1));
    __pyx_t_1 = 0;
+0317:             arr.data = <char*>self._ycoeffs_ptr
    __pyx_v_arr->data = ((char *)__pyx_v_self->_ycoeffs_ptr);
+0318:             self._xcoeffs = np.asarray(arr)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_arr)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_xcoeffs);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_xcoeffs);
    __pyx_v_self->_xcoeffs = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;
 0319: 
 0320: 
+0321:     cpdef set_up_pv_data(self):
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_17set_up_pv_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_7mus_any_set_up_pv_data(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, int __pyx_skip_dispatch) {
  mus_long_t __pyx_v_size;
  struct __pyx_array_obj *__pyx_v_pvai = 0;
  struct __pyx_array_obj *__pyx_v_pva = 0;
  struct __pyx_array_obj *__pyx_v_pvf = 0;
  struct __pyx_array_obj *__pyx_v_pvp = 0;
  struct __pyx_array_obj *__pyx_v_pvpi = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_pv_data", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_up_pv_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_8pysndlib_3clm_7mus_any_17set_up_pv_data)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_4, };
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_pv_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pvai);
  __Pyx_XDECREF((PyObject *)__pyx_v_pva);
  __Pyx_XDECREF((PyObject *)__pyx_v_pvf);
  __Pyx_XDECREF((PyObject *)__pyx_v_pvp);
  __Pyx_XDECREF((PyObject *)__pyx_v_pvpi);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_17set_up_pv_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_7mus_any_16set_up_pv_data, "\n        :meta private:\n        ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7mus_any_17set_up_pv_data = {"set_up_pv_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7mus_any_17set_up_pv_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_7mus_any_16set_up_pv_data};
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_17set_up_pv_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_pv_data (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("set_up_pv_data", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_up_pv_data", 0))) return NULL;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_16set_up_pv_data(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_16set_up_pv_data(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up_pv_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_7mus_any_set_up_pv_data(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.set_up_pv_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7mus_any_17set_up_pv_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_mus_any_set_up_pv_data, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any->tp_dict, __pyx_n_s_set_up_pv_data, __pyx_t_40) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  PyType_Modified(__pyx_ptype_8pysndlib_3clm_mus_any);
/* … */
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_set_up_pv_data, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 321, __pyx_L1_error)
 0322:         """
 0323:         :meta private:
 0324:         """
+0325:         cdef cclm.mus_long_t size = cclm.mus_length(self._ptr)
  __pyx_v_size = mus_length(__pyx_v_self->_ptr);
 0326: 
+0327:         self._pv_amp_increments_ptr = cclm.mus_phase_vocoder_amp_increments(self._ptr)
  __pyx_v_self->_pv_amp_increments_ptr = mus_phase_vocoder_amp_increments(__pyx_v_self->_ptr);
+0328:         cdef view.array pvai = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=True)
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemsize, __pyx_t_3) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pvai = ((struct __pyx_array_obj *)__pyx_t_3);
  __pyx_t_3 = 0;
+0329:         pvai.data = <char*>self._pv_amp_increments_ptr
  __pyx_v_pvai->data = ((char *)__pyx_v_self->_pv_amp_increments_ptr);
+0330:         self._pv_amp_increments = np.asarray(pvai)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_pvai)};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_pv_amp_increments);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_pv_amp_increments);
  __pyx_v_self->_pv_amp_increments = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
+0331:         self._pv_amp_increments.fill(0.0)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_pv_amp_increments), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_float_0_0};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0332: 
+0333:         self._pv_amps_ptr = cclm.mus_phase_vocoder_amps(self._ptr)
  __pyx_v_self->_pv_amps_ptr = mus_phase_vocoder_amps(__pyx_v_self->_ptr);
+0334:         cdef view.array pva = view.array(shape=(size // 2,),itemsize=sizeof(double), format='d', allocate_buffer=True)
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__Pyx_div_mus_long_t(__pyx_v_size, 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_itemsize, __pyx_t_1) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_pva = ((struct __pyx_array_obj *)__pyx_t_1);
  __pyx_t_1 = 0;
+0335:         pva.data = <char*>self._pv_amps_ptr
  __pyx_v_pva->data = ((char *)__pyx_v_self->_pv_amps_ptr);
+0336:         self._pv_amps = np.asarray(pva)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_pva)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_pv_amps);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_pv_amps);
  __pyx_v_self->_pv_amps = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
+0337:         self._pv_amps.fill(0.0)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_pv_amps), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_float_0_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0338: 
+0339:         self._pv_freqs_ptr = cclm.mus_phase_vocoder_freqs(self._ptr)
  __pyx_v_self->_pv_freqs_ptr = mus_phase_vocoder_freqs(__pyx_v_self->_ptr);
+0340:         cdef view.array pvf = view.array(shape=(size,),itemsize=sizeof(double), format='d', allocate_buffer=True)
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemsize, __pyx_t_3) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pvf = ((struct __pyx_array_obj *)__pyx_t_3);
  __pyx_t_3 = 0;
+0341:         pvf.data = <char*>self._pv_freqs_ptr
  __pyx_v_pvf->data = ((char *)__pyx_v_self->_pv_freqs_ptr);
+0342:         self._pv_freqs = np.asarray(pvf)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_pvf)};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_pv_freqs);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_pv_freqs);
  __pyx_v_self->_pv_freqs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
+0343:         self._pv_freqs.fill(0.0)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_pv_freqs), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_float_0_0};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0344: 
+0345:         self._pv_phases_ptr = cclm.mus_phase_vocoder_phases(self._ptr)
  __pyx_v_self->_pv_phases_ptr = mus_phase_vocoder_phases(__pyx_v_self->_ptr);
+0346:         cdef view.array pvp = view.array(shape=(size // 2,),itemsize=sizeof(double), format='d', allocate_buffer=True)
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__Pyx_div_mus_long_t(__pyx_v_size, 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_itemsize, __pyx_t_1) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_pvp = ((struct __pyx_array_obj *)__pyx_t_1);
  __pyx_t_1 = 0;
+0347:         pvp.data = <char*>self._pv_phases_ptr
  __pyx_v_pvp->data = ((char *)__pyx_v_self->_pv_phases_ptr);
+0348:         self._pv_phases = np.asarray(pvp)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_pvp)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_pv_phases);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_pv_phases);
  __pyx_v_self->_pv_phases = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
+0349:         self._pv_phases.fill(0.0)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_pv_phases), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_float_0_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0350: 
+0351:         self._pv_phase_increments_ptr = cclm.mus_phase_vocoder_phase_increments(self._ptr)
  __pyx_v_self->_pv_phase_increments_ptr = mus_phase_vocoder_phase_increments(__pyx_v_self->_ptr);
+0352:         cdef view.array pvpi = view.array(shape=(size // 2,),itemsize=sizeof(double), format='d', allocate_buffer=True)
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__Pyx_div_mus_long_t(__pyx_v_size, 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemsize, __pyx_t_3) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_n_s_d) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allocate_buffer, Py_True) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pvpi = ((struct __pyx_array_obj *)__pyx_t_3);
  __pyx_t_3 = 0;
+0353:         pvpi.data = <char*>self._pv_phase_increments_ptr
  __pyx_v_pvpi->data = ((char *)__pyx_v_self->_pv_phase_increments_ptr);
+0354:         self._pv_phase_increments = np.asarray(pvpi)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_pvpi)};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_pv_phase_increments);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_pv_phase_increments);
  __pyx_v_self->_pv_phase_increments = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
+0355:         self._pv_phase_increments.fill(0.0)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_pv_phase_increments), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_float_0_0};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0356: 
+0357:     def __call__(self, arg1=0.0, arg2=0.0):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arg1 = 0;
  PyObject *__pyx_v_arg2 = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arg1,&__pyx_n_s_arg2,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_float_0_0);
    values[1] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arg1);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arg2);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 357, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arg1 = values[0];
    __pyx_v_arg2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 357, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_18__call__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), __pyx_v_arg1, __pyx_v_arg2);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_18__call__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_arg1, PyObject *__pyx_v_arg2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0358:         return cclm.mus_apply(self._ptr, arg1,arg2)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_arg1); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error)
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_arg2); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(mus_apply(__pyx_v_self->_ptr, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;
 0359: 
+0360:     def __str__(self):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_21__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_21__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_20__str__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_20__str__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0361:         return f'{mus_any} {cclm.mus_describe(self._ptr)}'
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__17);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__17);
  __pyx_t_4 = __Pyx_PyUnicode_FromString(mus_describe(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;
 0362: 
 0363: 
+0364:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13mus_frequency_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13mus_frequency_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_13mus_frequency___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_13mus_frequency___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_frequency.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0365:     def mus_frequency(self):
 0366:         """
 0367:         frequency (hz), float
 0368:         """
+0369:         return cclm.mus_frequency(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_frequency(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0370: 
+0371:     @mus_frequency.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_13mus_frequency_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_13mus_frequency_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_13mus_frequency_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_13mus_frequency_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_frequency.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0372:     def mus_frequency(self, v):
+0373:         cclm.mus_set_frequency(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error)
  (void)(mus_set_frequency(__pyx_v_self->_ptr, __pyx_t_1));
 0374: 
+0375:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9mus_phase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9mus_phase_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_9mus_phase___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_9mus_phase___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_phase.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0376:     def mus_phase(self):
 0377:         """
 0378:         phase (radians), float
 0379:         """
+0380:         return cclm.mus_phase(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_phase(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0381: 
+0382:     @mus_phase.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_9mus_phase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_9mus_phase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_9mus_phase_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_9mus_phase_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_phase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0383:     def mus_phase(self, v):
+0384:         cclm.mus_set_phase(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L1_error)
  (void)(mus_set_phase(__pyx_v_self->_ptr, __pyx_t_1));
 0385: 
+0386:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_10mus_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_10mus_length_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10mus_length___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_10mus_length___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0387:     def mus_length(self):
 0388:         """
 0389:         data length, int
 0390:         """
+0391:         return cclm.mus_length(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_mus_long_t(mus_length(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0392: 
+0393:     @mus_length.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_10mus_length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_10mus_length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10mus_length_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_10mus_length_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_length.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0394:     def mus_length(self, v):
+0395:         cclm.mus_set_length(self._ptr, v)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error)
  (void)(mus_set_length(__pyx_v_self->_ptr, __pyx_t_1));
 0396: 
+0397:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13mus_increment_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_13mus_increment_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_13mus_increment___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_13mus_increment___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_increment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0398:     def mus_increment(self):
 0399:         """
 0400:         various increments, int
 0401:         """
+0402:         return cclm.mus_increment(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_increment(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0403: 
+0404:     @mus_increment.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_13mus_increment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_13mus_increment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_13mus_increment_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_13mus_increment_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_increment.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0405:     def mus_increment(self, v):
+0406:         cclm.mus_set_increment(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L1_error)
  (void)(mus_set_increment(__pyx_v_self->_ptr, __pyx_t_1));
 0407: 
+0408:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_12mus_location_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_12mus_location_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_12mus_location___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_12mus_location___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_location.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0409:     def mus_location(self):
 0410:         """
 0411:         sample location for reads/write, int
 0412:         """
+0413:         return cclm.mus_location(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_mus_long_t(mus_location(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0414: 
+0415:     @mus_location.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_12mus_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_12mus_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_12mus_location_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_12mus_location_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_location.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0416:     def mus_location(self, v):
+0417:         cclm.mus_set_location(self._ptr, v)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error)
  (void)(mus_set_location(__pyx_v_self->_ptr, __pyx_t_1));
 0418: 
+0419:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_10mus_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_10mus_offset_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10mus_offset___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_10mus_offset___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0420:     def mus_offset(self):
+0421:         return cclm.mus_offset(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_offset(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0422: 
+0423:     @mus_offset.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_10mus_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_10mus_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10mus_offset_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_10mus_offset_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0424:     def mus_offset(self, v):
 0425:         """
 0426:         envelope offset, int
 0427:         """
+0428:         cclm.mus_set_offset(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
  (void)(mus_set_offset(__pyx_v_self->_ptr, __pyx_t_1));
 0429: 
+0430:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_12mus_channels_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_12mus_channels_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_12mus_channels___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_12mus_channels___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_channels.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0431:     def mus_channels(self):
 0432:         """
 0433:         channels open, int
 0434:         """
+0435:         return cclm.mus_channels(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(mus_channels(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0436: 
 0437: 
+0438:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15mus_interp_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15mus_interp_type_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_15mus_interp_type___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_15mus_interp_type___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_interp_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0439:     def mus_interp_type(self):
 0440:         """
 0441:         interpolation type (inter.linear, etc), interp
 0442:         not setable
 0443:         """
+0444:         return cclm.mus_interp_type(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(mus_interp_type(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0445: 
+0446:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9mus_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9mus_width_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_9mus_width___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_9mus_width___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0447:     def mus_width(self):
 0448:         """
 0449:         width of interpolation tables, etc, int
 0450:         """
+0451:         return cclm.mus_width(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_width(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0452: 
+0453:     @mus_width.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_9mus_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_9mus_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_9mus_width_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_9mus_width_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0454:     def mus_width(self, v):
+0455:         cclm.mus_set_width(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error)
  (void)(mus_set_width(__pyx_v_self->_ptr, __pyx_t_1));
 0456: 
+0457:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9mus_order_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_9mus_order_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_9mus_order___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_9mus_order___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_order.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0458:     def mus_order(self):
 0459:         """
 0460:         filter order, int
 0461:         """
+0462:         return cclm.mus_order(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_mus_long_t(mus_order(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0463: 
+0464:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_10mus_scaler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_10mus_scaler_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10mus_scaler___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_10mus_scaler___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_scaler.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0465:     def mus_scaler(self):
 0466:         """
 0467:         scaler, normally on an amplitude, float
 0468:         """
+0469:         return cclm.mus_scaler(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_scaler(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0470: 
+0471:     @mus_scaler.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_10mus_scaler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_10mus_scaler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_10mus_scaler_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_10mus_scaler_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_scaler.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0472:     def mus_scaler(self, v):
+0473:         cclm.mus_set_scaler(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error)
  (void)(mus_set_scaler(__pyx_v_self->_ptr, __pyx_t_1));
 0474: 
+0475:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_12mus_feedback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_12mus_feedback_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_12mus_feedback___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_12mus_feedback___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_feedback.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0476:     def mus_feedback(self):
 0477:         """
 0478:         feedback coefficient, float
 0479:         """
+0480:         return cclm.mus_feedback(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_feedback(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0481: 
+0482:     @mus_feedback.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_12mus_feedback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_12mus_feedback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_12mus_feedback_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_12mus_feedback_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_feedback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0483:     def mus_feedback(self, v):
+0484:         cclm.mus_set_feedback(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
  (void)(mus_set_feedback(__pyx_v_self->_ptr, __pyx_t_1));
 0485: 
+0486:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15mus_feedforward_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_15mus_feedforward_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_15mus_feedforward___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_15mus_feedforward___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_feedforward.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0487:     def mus_feedforward(self):
 0488:         """
 0489:         feedforward coefficient, float
 0490:         """
+0491:         return cclm.mus_feedforward(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(mus_feedforward(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0492: 
+0493:     @mus_feedforward.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_15mus_feedforward_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_15mus_feedforward_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_15mus_feedforward_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_15mus_feedforward_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_feedforward.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0494:     def mus_feedforward(self, v):
+0495:         cclm.mus_set_feedforward(self._ptr, v)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error)
  (void)(mus_set_feedforward(__pyx_v_self->_ptr, __pyx_t_1));
 0496: 
+0497:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_7mus_hop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_7mus_hop_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_7mus_hop___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_7mus_hop___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_hop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0498:     def mus_hop(self):
 0499:         """
 0500:         hop size for block processing, int
 0501:         """
+0502:         return cclm.mus_hop(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_mus_long_t(mus_hop(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0503: 
+0504:     @mus_hop.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_7mus_hop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_7mus_hop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_7mus_hop_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_7mus_hop_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_hop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0505:     def mus_hop(self, v):
+0506:         cclm.mus_set_hop(self._ptr, v)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L1_error)
  (void)(mus_set_hop(__pyx_v_self->_ptr, __pyx_t_1));
 0507: 
+0508:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_8mus_ramp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_8mus_ramp_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_8mus_ramp___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_8mus_ramp___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_ramp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0509:     def mus_ramp(self):
 0510:         """
 0511:         granulate grain envelope ramp setting, int
 0512:         """
+0513:         return cclm.mus_ramp(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_mus_long_t(mus_ramp(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0514: 
+0515:     @mus_ramp.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_8mus_ramp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_8mus_ramp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_8mus_ramp_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_8mus_ramp_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_ramp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0516:     def mus_ramp(self, v):
+0517:         cclm.mus_set_ramp(self._ptr, v)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_v); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error)
  (void)(mus_set_ramp(__pyx_v_self->_ptr, __pyx_t_1));
 0518: 
+0519:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11mus_channel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11mus_channel_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_11mus_channel___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_11mus_channel___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_channel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0520:     def mus_channel(self):
 0521:         """
 0522:         channel being read/written, int
 0523:         """
+0524:         return cclm.mus_channel(self._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(mus_channel(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0525: 
+0526:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_8mus_data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_8mus_data_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_8mus_data___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_8mus_data___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0527:     def mus_data(self):
 0528:         """
 0529:         array of data, np.ndarray
 0530:         """
+0531:         if not cclm.mus_data_exists(self._ptr):   #could do this on all properties but seems best with array 
  __pyx_t_1 = (!mus_data_exists(__pyx_v_self->_ptr));
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0532:             raise TypeError(f'mus_data can not be called on {cclm.mus_name(self._ptr)}')
    __pyx_t_2 = __Pyx_PyUnicode_FromString(mus_name(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_mus_data_can_not_be_called_on, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 532, __pyx_L1_error)
+0533:         return self._data
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_data);
  __pyx_r = ((PyObject *)__pyx_v_self->_data);
  goto __pyx_L0;
 0534: 
+0535:     @mus_data.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_7mus_any_8mus_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static int __pyx_pw_8pysndlib_3clm_7mus_any_8mus_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_8mus_data_2__set__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_7mus_any_8mus_data_2__set__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self, PyObject *__pyx_v_data) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_data.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0536:     def mus_data(self, data: npt.NDArray[np.float64]):
+0537:         if not cclm.mus_data_exists(self._ptr):   #could do this on all properties but seems best with array 
  __pyx_t_1 = (!mus_data_exists(__pyx_v_self->_ptr));
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0538:             raise TypeError(f'mus_data can not be called on {cclm.mus_name(self._ptr)}')
    __pyx_t_2 = __Pyx_PyUnicode_FromString(mus_name(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_mus_data_can_not_be_called_on, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 538, __pyx_L1_error)
 0539: 
+0540:         np.copyto(self._data , data)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copyto); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self->_data), __pyx_v_data};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 0541: 
+0542:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11mus_xcoeffs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11mus_xcoeffs_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_11mus_xcoeffs___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_11mus_xcoeffs___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_xcoeffs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0543:     def mus_xcoeffs(self):
 0544:         """
 0545:         x (input) coefficient, np.ndarray
 0546:         not setable
 0547:         """
+0548:         if not cclm.mus_xcoeffs_exists(self._ptr):   #could do this on all properties but seems best with array 
  __pyx_t_1 = (!mus_xcoeffs_exists(__pyx_v_self->_ptr));
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0549:             raise TypeError(f'mus_xcoeffs can not be called on {cclm.mus_name(self._ptr)}')
    __pyx_t_2 = __Pyx_PyUnicode_FromString(mus_name(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_mus_xcoeffs_can_not_be_called_on, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 549, __pyx_L1_error)
+0550:         return self._xcoeffs
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_xcoeffs);
  __pyx_r = ((PyObject *)__pyx_v_self->_xcoeffs);
  goto __pyx_L0;
 0551: 
+0552:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11mus_ycoeffs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_7mus_any_11mus_ycoeffs_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_7mus_any_11mus_ycoeffs___get__(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_7mus_any_11mus_ycoeffs___get__(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.mus_any.mus_ycoeffs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0553:     def mus_ycoeffs(self):
 0554:         """
 0555:         y (output, feedback) coefficient, np.ndarray
 0556:         not setable
 0557:         """
+0558:         if not cclm.mus_xcoeffs_exists(self._ptr):   #could do this on all properties but seems best with array 
  __pyx_t_1 = (!mus_xcoeffs_exists(__pyx_v_self->_ptr));
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0559:             raise TypeError(f'mus_ycoeffs can not be called on {cclm.mus_name(self._ptr)}')
    __pyx_t_2 = __Pyx_PyUnicode_FromString(mus_name(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_mus_ycoeffs_can_not_be_called_on, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 559, __pyx_L1_error)
+0560:         return self._ycoeffs
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_ycoeffs);
  __pyx_r = ((PyObject *)__pyx_v_self->_ycoeffs);
  goto __pyx_L0;
 0561: 
 0562: 
 0563: 
+0564: cdef class mus_any_array:
struct __pyx_obj_8pysndlib_3clm_mus_any_array {
  PyObject_HEAD
  struct __pyx_vtabstruct_8pysndlib_3clm_mus_any_array *__pyx_vtab;
  mus_any_ptr_ptr data;
  size_t item_count;
};
/* … */
struct __pyx_vtabstruct_8pysndlib_3clm_mus_any_array {
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *(*from_pylist)(PyObject *);
};
static struct __pyx_vtabstruct_8pysndlib_3clm_mus_any_array *__pyx_vtabptr_8pysndlib_3clm_mus_any_array;

 0565:     """
 0566:     a wrapper class arrays of mus_any objects
 0567:     :meta private:
 0568:     """
 0569:     cdef  cclm.mus_any_ptr_ptr data
 0570:     item_count: cython.size_t
+0571:     def __cinit__(self, number: cython.size_t):
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_13mus_any_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8pysndlib_3clm_13mus_any_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_number;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_number,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_number)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 571, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
    }
    __pyx_v_number = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_number == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 571, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_13mus_any_array___cinit__(((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_v_self), __pyx_v_number);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_13mus_any_array___cinit__(struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_self, size_t __pyx_v_number) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_any_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0572:         # allocate some memory (uninitialised, may contain arbitrary data)
+0573:         if number > 0:
  __pyx_t_1 = (__pyx_v_number > 0);
  if (__pyx_t_1) {
/* … */
  }
+0574:             self.data = cython.cast(cclm.mus_any_ptr_ptr, PyMem_Malloc(
    __pyx_v_self->data = ((mus_any_ptr_ptr)PyMem_Malloc((__pyx_v_number * (sizeof(mus_any_ptr)))));
 0575:                 number * cython.sizeof(cclm.mus_any_ptr)))
+0576:             if not self.data:
    __pyx_t_1 = (!(__pyx_v_self->data != 0));
    if (unlikely(__pyx_t_1)) {
/* … */
    }
+0577:                 raise MemoryError()
      PyErr_NoMemory(); __PYX_ERR(0, 577, __pyx_L1_error)
+0578:         self.item_count = number
  __pyx_v_self->item_count = __pyx_v_number;
 0579: 
 0580: 
+0581:     def __dealloc__(self):
/* Python wrapper */
static void __pyx_pw_8pysndlib_3clm_13mus_any_array_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8pysndlib_3clm_13mus_any_array_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_8pysndlib_3clm_13mus_any_array_2__dealloc__(((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_8pysndlib_3clm_13mus_any_array_2__dealloc__(struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
}
+0582:         PyMem_Free(self.data)  # no-op if self.data is null
  PyMem_Free(__pyx_v_self->data);
 0583: 
+0584:     def __len__(self):
/* Python wrapper */
static Py_ssize_t __pyx_pw_8pysndlib_3clm_13mus_any_array_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_8pysndlib_3clm_13mus_any_array_5__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_13mus_any_array_4__len__(((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_8pysndlib_3clm_13mus_any_array_4__len__(struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0585:         return self.item_count
  __pyx_r = __pyx_v_self->item_count;
  goto __pyx_L0;
 0586: 
+0587:     def __str__(self):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_13mus_any_array_7__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_13mus_any_array_7__str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_13mus_any_array_6__str__(((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_13mus_any_array_6__str__(struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.mus_any_array.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0588:         return f"count {self.item_count}"
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_self->item_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_count, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 0589: 
 0590:     @staticmethod
+0591:     cdef mus_any_array from_pylist(lst: list):
static struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_f_8pysndlib_3clm_13mus_any_array_from_pylist(PyObject *__pyx_v_lst) {
  int __pyx_v_i;
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_wrapper = 0;
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pylist", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.mus_any_array.from_pylist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_wrapper);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0592:         """
 0593:         factory function to create a wrapper around mus_float_t (double) and fill it with values from the list
 0594:         """
 0595:         cdef int i
 0596: 
+0597:         cdef mus_any_array wrapper = mus_any_array(len(lst))
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_lst); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8pysndlib_3clm_mus_any_array), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_wrapper = ((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_t_3);
  __pyx_t_3 = 0;
+0598:         for i in range(len(lst)):
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_lst); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 598, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;
+0599:             wrapper.data[i] = (<mus_any>lst[i])._ptr
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_lst, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3)->_ptr;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_wrapper->data[__pyx_v_i]) = __pyx_t_6;
  }
+0600:         return wrapper
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_wrapper);
  __pyx_r = __pyx_v_wrapper;
  goto __pyx_L0;
 0601: 
 0602: 
 0603: 
 0604: 
 0605: # --------------- callbacks ---------------- #
 0606: 
+0607: cdef double input_callback_func(void* arg, int direction):
static double __pyx_f_8pysndlib_3clm_input_callback_func(void *__pyx_v_arg, int __pyx_v_direction) {
  mus_any_ptr __pyx_v_gen;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_callback_func", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0608:     cdef cclm.mus_any_ptr gen = <cclm.mus_any_ptr>arg
  __pyx_v_gen = ((mus_any_ptr)__pyx_v_arg);
+0609:     return cclm.mus_apply(gen, direction, 0.)
  __pyx_r = mus_apply(__pyx_v_gen, __pyx_v_direction, 0.);
  goto __pyx_L0;
 0610: 
 0611: 
+0612: cdef void locsig_detour_callback_func(cclm.mus_any *ptr, cclm.mus_long_t val):
static void __pyx_f_8pysndlib_3clm_locsig_detour_callback_func(mus_any *__pyx_v_ptr, mus_long_t __pyx_v_val) {
  int __pyx_v_channels;
  int __pyx_v_reverb_channels;
  mus_float_t *__pyx_v_outf;
  mus_float_t *__pyx_v_revf;
  int __pyx_v_i;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_detour_callback_func", 0);
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.locsig_detour_callback_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}
+0613:     cdef int channels = cclm.mus_locsig_channels(ptr)
  __pyx_v_channels = mus_locsig_channels(__pyx_v_ptr);
+0614:     cdef int reverb_channels = cclm.mus_locsig_reverb_channels(ptr)
  __pyx_v_reverb_channels = mus_locsig_reverb_channels(__pyx_v_ptr);
+0615:     cdef cclm.mus_float_t* outf = cclm.mus_locsig_outf(ptr)
  __pyx_v_outf = mus_locsig_outf(__pyx_v_ptr);
+0616:     cdef cclm.mus_float_t* revf = cclm.mus_locsig_revf(ptr)
  __pyx_v_revf = mus_locsig_revf(__pyx_v_ptr);
+0617:     for i in range(channels):
  __pyx_t_1 = __pyx_v_channels;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
+0618:          CLM.output[i][val] += outf[i]
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __pyx_v_val;
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_6, mus_long_t, 1, __Pyx_PyInt_From_mus_long_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_outf[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_t_6, __pyx_t_8, mus_long_t, 1, __Pyx_PyInt_From_mus_long_t, 0, 1, 1) < 0))) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
+0619:     for i in range(reverb_channels):
  __pyx_t_1 = __pyx_v_reverb_channels;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
+0620:          CLM.reverb[i][val] += revf[i]
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reverb); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = __pyx_v_val;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_6, mus_long_t, 1, __Pyx_PyInt_From_mus_long_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_revf[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_t_6, __pyx_t_5, mus_long_t, 1, __Pyx_PyInt_From_mus_long_t, 0, 1, 1) < 0))) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
 0621: 
 0622: 
 0623: # --------------- file2ndarray, ndarray2file ---------------- #                 
+0624: cpdef file2ndarray(filename: str, channel: Optional[int]=None, beg: Optional[int]=None, dur: Optional[int]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_7file2ndarray(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_file2ndarray(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_file2ndarray *__pyx_optional_args) {
  PyObject *__pyx_v_channel = ((PyObject *)Py_None);
  PyObject *__pyx_v_beg = ((PyObject *)Py_None);
  PyObject *__pyx_v_dur = ((PyObject *)Py_None);
  PyObject *__pyx_v_length = NULL;
  int __pyx_v_chans;
  int __pyx_v_srate;
  PyObject *__pyx_v_bg = NULL;
  PyObject *__pyx_v_out = NULL;
  __Pyx_memviewslice __pyx_v_arr_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2ndarray", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_channel = __pyx_optional_args->channel;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_beg = __pyx_optional_args->beg;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_dur = __pyx_optional_args->dur;
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("pysndlib.clm.file2ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_bg);
  __Pyx_XDECREF(__pyx_v_out);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_arr_view, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_7file2ndarray(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_6file2ndarray, "\n    return an ndarray with samples from file and the sample rate of the data\n    \n    :param filename: filename\n    :param channel: if None, will read all channels, otherwise just channel specified \n    :param beg: beginning positions to read in samples\n    :param dur: duration in samples to read\n    :return: tuple of np.ndarray and sample rate\n    :rtype: tuple\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_7file2ndarray = {"file2ndarray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_7file2ndarray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_6file2ndarray};
static PyObject *__pyx_pw_8pysndlib_3clm_7file2ndarray(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_beg = 0;
  PyObject *__pyx_v_dur = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2ndarray (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_channel,&__pyx_n_s_beg,&__pyx_n_s_dur,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channel);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_beg);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dur);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "file2ndarray") < 0)) __PYX_ERR(0, 624, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = ((PyObject*)values[0]);
    __pyx_v_channel = values[1];
    __pyx_v_beg = values[2];
    __pyx_v_dur = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("file2ndarray", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 624, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.file2ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 0, "filename", 1))) __PYX_ERR(0, 624, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_6file2ndarray(__pyx_self, __pyx_v_filename, __pyx_v_channel, __pyx_v_beg, __pyx_v_dur);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_6file2ndarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_channel, PyObject *__pyx_v_beg, PyObject *__pyx_v_dur) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2ndarray", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.channel = __pyx_v_channel;
  __pyx_t_2.beg = __pyx_v_beg;
  __pyx_t_2.dur = __pyx_v_dur;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_file2ndarray(__pyx_v_filename, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.file2ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__121 = PyTuple_Pack(4, __pyx_n_s_filename, __pyx_n_s_channel, __pyx_n_s_beg, __pyx_n_s_dur); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_filename, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_channel, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_beg, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_dur, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_7file2ndarray, 0, __pyx_n_s_file2ndarray, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__62);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file2ndarray, __pyx_t_41) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_file2ndarray, 624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 624, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_file2ndarray {
  int __pyx_n;
  PyObject *channel;
  PyObject *beg;
  PyObject *dur;
};
 0625:     """
 0626:     return an ndarray with samples from file and the sample rate of the data
 0627:     
 0628:     :param filename: filename
 0629:     :param channel: if None, will read all channels, otherwise just channel specified 
 0630:     :param beg: beginning positions to read in samples
 0631:     :param dur: duration in samples to read
 0632:     :return: tuple of np.ndarray and sample rate
 0633:     :rtype: tuple
 0634:     
 0635:     """
+0636:     length = dur or csndlib.mus_sound_framples(filename)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dur); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 636, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_dur);
    __pyx_t_1 = __pyx_v_dur;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L1_error)
  __pyx_t_4 = mus_sound_framples(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_mus_long_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_length = __pyx_t_1;
  __pyx_t_1 = 0;
+0637:     chans = csndlib.mus_sound_chans(filename)
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 637, __pyx_L1_error)
  __pyx_v_chans = mus_sound_chans(__pyx_t_6);
+0638:     srate = csndlib.mus_sound_srate(filename)
  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error)
  __pyx_v_srate = mus_sound_srate(__pyx_t_7);
+0639:     bg = beg or 0
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_beg); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 639, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_beg);
    __pyx_t_1 = __pyx_v_beg;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_L5_bool_binop_done:;
  __pyx_v_bg = __pyx_t_1;
  __pyx_t_1 = 0;
+0640:     out = np.zeros((1 if (channel != None) else chans, length), dtype=np.double)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = PyObject_RichCompare(__pyx_v_channel, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_int_1);
    __pyx_t_1 = __pyx_int_1;
  } else {
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_chans); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __pyx_t_8;
    __pyx_t_8 = 0;
  }
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_length);
  __Pyx_GIVEREF(__pyx_v_length);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_length);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_out = __pyx_t_10;
  __pyx_t_10 = 0;
 0641: 
+0642:     cdef double [: , :] arr_view = out
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_v_out, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
  __pyx_v_arr_view = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;
 0643: 
+0644:     if not channel:
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_channel); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 644, __pyx_L1_error)
  __pyx_t_12 = (!__pyx_t_2);
  if (__pyx_t_12) {
/* … */
    goto __pyx_L7;
  }
+0645:         for i in range(chans):
    __pyx_t_13 = __pyx_v_chans;
    __pyx_t_14 = __pyx_t_13;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_i = __pyx_t_15;
+0646:             csndlib.mus_file_to_array(filename, i, bg, length, &arr_view[0][i])
      __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyInt_As_mus_long_t(__pyx_v_bg); if (unlikely((__pyx_t_4 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L1_error)
      __pyx_t_17 = __Pyx_PyInt_As_mus_long_t(__pyx_v_length); if (unlikely((__pyx_t_17 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L1_error)
      __pyx_t_18 = 0;
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_v_arr_view.shape[0];
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_v_arr_view.shape[0])) __pyx_t_20 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_v_arr_view.shape[1];
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_v_arr_view.shape[1])) __pyx_t_20 = 1;
      if (unlikely(__pyx_t_20 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_20);
        __PYX_ERR(0, 646, __pyx_L1_error)
      }
      (void)(mus_file_to_array(__pyx_t_16, __pyx_v_i, __pyx_t_4, __pyx_t_17, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_view.data + __pyx_t_18 * __pyx_v_arr_view.strides[0]) ) + __pyx_t_19 * __pyx_v_arr_view.strides[1]) ))))));
    }
 0647:     else:
+0648:         csndlib.mus_file_to_array(filename,0, bg, length, &arr_view[0][0])
  /*else*/ {
    __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_17 = __Pyx_PyInt_As_mus_long_t(__pyx_v_bg); if (unlikely((__pyx_t_17 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_mus_long_t(__pyx_v_length); if (unlikely((__pyx_t_4 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_19 = 0;
    __pyx_t_18 = 0;
    __pyx_t_13 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_v_arr_view.shape[0];
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_v_arr_view.shape[0])) __pyx_t_13 = 0;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_v_arr_view.shape[1];
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 1;
    } else if (unlikely(__pyx_t_18 >= __pyx_v_arr_view.shape[1])) __pyx_t_13 = 1;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 648, __pyx_L1_error)
    }
    (void)(mus_file_to_array(__pyx_t_16, 0, __pyx_t_17, __pyx_t_4, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arr_view.data + __pyx_t_19 * __pyx_v_arr_view.strides[0]) ) + __pyx_t_18 * __pyx_v_arr_view.strides[1]) ))))));
  }
  __pyx_L7:;
+0649:     return out, srate
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_srate); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_out);
  __Pyx_GIVEREF(__pyx_v_out);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_out);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;
 0650: 
+0651: cpdef ndarray2file(filename: str, arr: npt.NDArray[np.float64], length=None, sr=None, sample_type: Optional[sndlib.sample]=CLM.sample_type, header_type: Optional[sndlib.header]=CLM.header_type, comment=None ):
static PyObject *__pyx_pw_8pysndlib_3clm_9ndarray2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_ndarray2file(PyObject *__pyx_v_filename, PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_ndarray2file *__pyx_optional_args) {
  PyObject *__pyx_v_length = ((PyObject *)Py_None);
  PyObject *__pyx_v_sr = ((PyObject *)Py_None);
  PyObject *__pyx_v_sample_type = __pyx_k__18;
  PyObject *__pyx_v_header_type = __pyx_k__19;
  PyObject *__pyx_v_chans = NULL;
  int __pyx_v_fd;
  mus_float_t **__pyx_v_obuf;
  __Pyx_memviewslice __pyx_v_arr_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_i = NULL;
  CYTHON_UNUSED int __pyx_v_err;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ndarray2file", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_length = __pyx_optional_args->length;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_sr = __pyx_optional_args->sr;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_sample_type = __pyx_optional_args->sample_type;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_header_type = __pyx_optional_args->header_type;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_length);
  __Pyx_INCREF(__pyx_v_sr);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1);
  __Pyx_AddTraceback("pysndlib.clm.ndarray2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chans);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_arr_view, 1);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_sr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_9ndarray2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_8ndarray2file, "\n    write an ndarray of samples to file\n    \n    :param filename: name of file\n    :param arr: np.ndarray of samples\n    :param length: length of samples to write. if None write all\n    :param sr: sample rate of file to write\n    :param sample_type: type of sample type to use. defaults to clm.sample_type\n    :param header_type: header of sample type to use. defaults to clm.header_type\n    :return: length in samples of file\n    :rtype: int\n    \n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_9ndarray2file = {"ndarray2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_9ndarray2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_8ndarray2file};
static PyObject *__pyx_pw_8pysndlib_3clm_9ndarray2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_sr = 0;
  PyObject *__pyx_v_sample_type = 0;
  PyObject *__pyx_v_header_type = 0;
  PyObject *__pyx_v_comment = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ndarray2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_arr,&__pyx_n_s_length,&__pyx_n_s_sr,&__pyx_n_s_sample_type,&__pyx_n_s_header_type,&__pyx_n_s_comment,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k__18;
    values[5] = __pyx_k__19;
    values[6] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("ndarray2file", 0, 2, 7, 1); __PYX_ERR(0, 651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sr);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sample_type);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_type);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comment);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 651, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ndarray2file") < 0)) __PYX_ERR(0, 651, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = ((PyObject*)values[0]);
    __pyx_v_arr = values[1];
    __pyx_v_length = values[2];
    __pyx_v_sr = values[3];
    __pyx_v_sample_type = values[4];
    __pyx_v_header_type = values[5];
    __pyx_v_comment = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ndarray2file", 0, 2, 7, __pyx_nargs); __PYX_ERR(0, 651, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.ndarray2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 0, "filename", 1))) __PYX_ERR(0, 651, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_8ndarray2file(__pyx_self, __pyx_v_filename, __pyx_v_arr, __pyx_v_length, __pyx_v_sr, __pyx_v_sample_type, __pyx_v_header_type, __pyx_v_comment);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_8ndarray2file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_arr, PyObject *__pyx_v_length, PyObject *__pyx_v_sr, PyObject *__pyx_v_sample_type, PyObject *__pyx_v_header_type, PyObject *__pyx_v_comment) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ndarray2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.length = __pyx_v_length;
  __pyx_t_2.sr = __pyx_v_sr;
  __pyx_t_2.sample_type = __pyx_v_sample_type;
  __pyx_t_2.header_type = __pyx_v_header_type;
  __pyx_t_2.comment = __pyx_v_comment;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_ndarray2file(__pyx_v_filename, __pyx_v_arr, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.ndarray2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_CLM); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_k__18 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_CLM); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_header_type); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_k__19 = __pyx_t_41;
  __Pyx_GIVEREF(__pyx_t_41);
  __pyx_t_41 = 0;
/* … */
  __pyx_tuple__123 = PyTuple_Pack(7, __pyx_n_s_filename, __pyx_n_s_arr, __pyx_n_s_length, __pyx_n_s_sr, __pyx_n_s_sample_type, __pyx_n_s_header_type, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_CLM); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_CLM); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_header_type); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = PyTuple_New(5); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 0, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 1, Py_None);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_41, 2, __pyx_t_40);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_41, 3, __pyx_t_37);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 4, Py_None);
  __pyx_t_40 = 0;
  __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_filename, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_arr, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_sample_type, __pyx_kp_s_Optional_sndlib_sample) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_header_type, __pyx_kp_s_Optional_sndlib_header) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_9ndarray2file, 0, __pyx_n_s_ndarray2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ndarray2file, __pyx_t_40) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_ndarray2file, 651, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 651, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_ndarray2file {
  int __pyx_n;
  PyObject *length;
  PyObject *sr;
  PyObject *sample_type;
  PyObject *header_type;
  PyObject *comment;
};
 0652:     """
 0653:     write an ndarray of samples to file
 0654:     
 0655:     :param filename: name of file
 0656:     :param arr: np.ndarray of samples
 0657:     :param length: length of samples to write. if None write all
 0658:     :param sr: sample rate of file to write
 0659:     :param sample_type: type of sample type to use. defaults to clm.sample_type
 0660:     :param header_type: header of sample type to use. defaults to clm.header_type
 0661:     :return: length in samples of file
 0662:     :rtype: int
 0663:     
 0664:     
 0665:     """
 0666: 
+0667:     if not sr:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sr); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 667, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {
/* … */
  }
+0668:         sr = CLM.srate
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_srate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_sr, __pyx_t_4);
    __pyx_t_4 = 0;
 0669: 
+0670:     chans = np.shape(arr)[0]
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_arr};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_chans = __pyx_t_5;
  __pyx_t_5 = 0;
+0671:     length = length or np.shape(arr)[1]
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_length); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 671, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_length);
    __pyx_t_5 = __pyx_v_length;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_arr};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_length, __pyx_t_5);
  __pyx_t_5 = 0;
+0672:     fd = csndlib.mus_sound_open_output(filename, int(sr), chans, sample_type, header_type, NULL)
  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_sr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_sample_type); if (unlikely((__pyx_t_10 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
  __pyx_t_11 = __Pyx_PyInt_As_mus_header_t(__pyx_v_header_type); if (unlikely((__pyx_t_11 == ((mus_header_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
  __pyx_v_fd = mus_sound_open_output(__pyx_t_8, __pyx_t_6, __pyx_t_9, __pyx_t_10, __pyx_t_11, NULL);
 0673: 
+0674:     cdef cclm.mus_float_t **obuf = <cclm.mus_float_t**>PyMem_Malloc(chans * sizeof(cclm.mus_float_t*))
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(mus_float_t *))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyNumber_Multiply(__pyx_v_chans, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_obuf = ((mus_float_t **)PyMem_Malloc(__pyx_t_12));
 0675: 
+0676:     if not obuf:
  __pyx_t_2 = (!(__pyx_v_obuf != 0));
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0677:         raise MemoryError()
    PyErr_NoMemory(); __PYX_ERR(0, 677, __pyx_L1_error)
 0678: 
+0679:     cdef double [:] arr_view = arr[0]
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_arr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_arr_view = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;
 0680: 
+0681:     try:
  /*try:*/ {
+0682:         for i in range(chans):
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_chans); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 682, __pyx_L8_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_7); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 682, __pyx_L8_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14); __Pyx_INCREF(__pyx_t_7); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 682, __pyx_L8_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_15(__pyx_t_5);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 682, __pyx_L8_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;
/* … */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
+0683:             arr_view = arr[i]
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 683, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 683, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_arr_view, 1);
      __pyx_v_arr_view = __pyx_t_13;
      __pyx_t_13.memview = NULL;
      __pyx_t_13.data = NULL;
+0684:             obuf[i] = &arr_view[0]
      __pyx_t_16 = 0;
      __pyx_t_9 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_v_arr_view.shape[0];
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_v_arr_view.shape[0])) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        __PYX_ERR(0, 684, __pyx_L8_error)
      }
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L8_error)
      (__pyx_v_obuf[__pyx_t_17]) = (&(*((double *) ( /* dim=0 */ (__pyx_v_arr_view.data + __pyx_t_16 * __pyx_v_arr_view.strides[0]) ))));
 0685: 
 0686:     finally:
+0687:         err = csndlib.mus_file_write(fd, 0, length, chans, obuf)
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_18 = __Pyx_PyInt_As_mus_long_t(__pyx_v_length); if (unlikely((__pyx_t_18 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_v_err = mus_file_write(__pyx_v_fd, 0, __pyx_t_18, __pyx_t_9, __pyx_v_obuf);
/* … */
        __pyx_t_18 = __Pyx_PyInt_As_mus_long_t(__pyx_v_length); if (unlikely((__pyx_t_18 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L14_error)
        __pyx_t_26 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_26 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L14_error)
        __pyx_v_err = mus_file_write(__pyx_v_fd, 0, __pyx_t_18, __pyx_t_26, __pyx_v_obuf);
+0688:         csndlib.mus_sound_close_output(fd, length * csndlib.mus_bytes_per_sample(sample_type)*chans)
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_sample_type); if (unlikely((__pyx_t_10 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyInt_From_int(mus_bytes_per_sample(__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyNumber_Multiply(__pyx_v_length, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Multiply(__pyx_t_7, __pyx_v_chans); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_18 = __Pyx_PyInt_As_mus_long_t(__pyx_t_5); if (unlikely((__pyx_t_18 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      (void)(mus_sound_close_output(__pyx_v_fd, __pyx_t_18));
/* … */
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_sample_type); if (unlikely((__pyx_t_10 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L14_error)
        __pyx_t_5 = __Pyx_PyInt_From_int(mus_bytes_per_sample(__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyNumber_Multiply(__pyx_v_length, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Multiply(__pyx_t_7, __pyx_v_chans); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_18 = __Pyx_PyInt_As_mus_long_t(__pyx_t_5); if (unlikely((__pyx_t_18 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        (void)(mus_sound_close_output(__pyx_v_fd, __pyx_t_18));
+0689:         PyMem_Free(obuf)
      PyMem_Free(__pyx_v_obuf);
      goto __pyx_L9;
    }
    __pyx_L8_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_22);
      __Pyx_XGOTREF(__pyx_t_23);
      __Pyx_XGOTREF(__pyx_t_24);
      __Pyx_XGOTREF(__pyx_t_25);
      __pyx_t_9 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
      {
/* … */
        PyMem_Free(__pyx_v_obuf);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_24);
        __Pyx_XGIVEREF(__pyx_t_25);
        __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
      }
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_22);
      __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
      __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_19;
      goto __pyx_L1_error;
      __pyx_L14_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_24);
        __Pyx_XGIVEREF(__pyx_t_25);
        __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
      }
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
      __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L9:;
  }
 0690: 
+0691:     return length
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_length);
  __pyx_r = __pyx_v_length;
  goto __pyx_L0;
 0692: 
 0693: # --------------- with sound context manager ---------------- #      
+0694: class Sound(object):
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
/* … */
  __pyx_t_40 = __Pyx_PEP560_update_bases(__pyx_tuple__126); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_CalculateMetaclass(NULL, __pyx_t_40); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_41 = __Pyx_Py3MetaclassPrepare(__pyx_t_37, __pyx_t_40, __pyx_n_s_Sound, __pyx_n_s_Sound, (PyObject *) NULL, __pyx_n_s_pysndlib_clm, __pyx_kp_s_context_manager_which_handles_c); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (__pyx_t_40 != __pyx_tuple__126) {
    if (unlikely((PyDict_SetItemString(__pyx_t_41, "__orig_bases__", __pyx_tuple__126) < 0))) __PYX_ERR(0, 694, __pyx_L1_error)
  }
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
/* … */
  __pyx_t_43 = __Pyx_Py3ClassCreate(__pyx_t_37, __pyx_n_s_Sound, __pyx_t_40, __pyx_t_41, NULL, 0, 0); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sound, __pyx_t_43) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
 0695:     """
 0696:     context manager which handles creating output and other options
 0697:     
 0698:     :param output: Can be a filename string or np.ndarray
 0699:     :param channels: number of channels \in main output
 0700:     :param srate:  output sampling rate 
 0701:     :param sample_type: output sample data type
 0702:     :param header_type: output header type 
 0703:     :param comment: any comment to store \in the header
 0704:     :param verbose: if True, print out some info (doesn't do anything now)
 0705:     :param reverb: reverb instrument
 0706:     :param reverb_data: arguments passed to the reverb (dictionary)
 0707:     :param reverb_channels: chans \in the reverb intermediate file
 0708:     :param revfile: reverb intermediate output file name
 0709:     :param continue_old_file: if True, continue a previous computation
 0710:     :param statistics: if True, print info at end of with-sound (compile time, maxamps)
 0711:     :param scaled_to: if a number, scale the output to peak at that amp
 0712:     :param scaled_by: is a number, scale output by that amp
 0713:     :param play: if True, play the sound automatically
 0714:     :param finalize: a function to call on exit from the context. should be a function that takes one argument, the name of the sound file or the ndarray 
 0715:         used as output
 0716:     """
 0717: 
+0718:     def __init__(self, output=None,
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_5Sound_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_5Sound_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_5Sound_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_5Sound_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_channels = 0;
  PyObject *__pyx_v_srate = 0;
  PyObject *__pyx_v_sample_type = 0;
  PyObject *__pyx_v_header_type = 0;
  PyObject *__pyx_v_comment = 0;
  PyObject *__pyx_v_verbose = 0;
  PyObject *__pyx_v_reverb = 0;
  PyObject *__pyx_v_revfile = 0;
  PyObject *__pyx_v_reverb_data = 0;
  PyObject *__pyx_v_reverb_channels = 0;
  PyObject *__pyx_v_continue_old_file = 0;
  PyObject *__pyx_v_statistics = 0;
  PyObject *__pyx_v_scaled_to = 0;
  PyObject *__pyx_v_scaled_by = 0;
  PyObject *__pyx_v_play = 0;
  PyObject *__pyx_v_clipped = 0;
  PyObject *__pyx_v_finalize = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_output,&__pyx_n_s_channels,&__pyx_n_s_srate,&__pyx_n_s_sample_type,&__pyx_n_s_header_type,&__pyx_n_s_comment,&__pyx_n_s_verbose,&__pyx_n_s_reverb,&__pyx_n_s_revfile,&__pyx_n_s_reverb_data,&__pyx_n_s_reverb_channels,&__pyx_n_s_continue_old_file,&__pyx_n_s_statistics,&__pyx_n_s_scaled_to,&__pyx_n_s_scaled_by,&__pyx_n_s_play,&__pyx_n_s_clipped,&__pyx_n_s_finalize,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_5Sound___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_output, PyObject *__pyx_v_channels, PyObject *__pyx_v_srate, PyObject *__pyx_v_sample_type, PyObject *__pyx_v_header_type, PyObject *__pyx_v_comment, PyObject *__pyx_v_verbose, PyObject *__pyx_v_reverb, PyObject *__pyx_v_revfile, PyObject *__pyx_v_reverb_data, PyObject *__pyx_v_reverb_channels, PyObject *__pyx_v_continue_old_file, PyObject *__pyx_v_statistics, PyObject *__pyx_v_scaled_to, PyObject *__pyx_v_scaled_by, PyObject *__pyx_v_play, PyObject *__pyx_v_clipped, PyObject *__pyx_v_finalize) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__127 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_output, __pyx_n_s_channels, __pyx_n_s_srate, __pyx_n_s_sample_type, __pyx_n_s_header_type, __pyx_n_s_comment, __pyx_n_s_verbose, __pyx_n_s_reverb, __pyx_n_s_revfile, __pyx_n_s_reverb_data, __pyx_n_s_reverb_channels, __pyx_n_s_continue_old_file, __pyx_n_s_statistics, __pyx_n_s_scaled_to, __pyx_n_s_scaled_by, __pyx_n_s_play, __pyx_n_s_clipped, __pyx_n_s_finalize); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(19, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_init, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 718, __pyx_L1_error)
/* … */
  __pyx_t_43 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_5Sound_1__init__, 0, __pyx_n_s_Sound___init, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_43, __pyx_tuple__129);
  if (__Pyx_SetNameInClass(__pyx_t_41, __pyx_n_s_init, __pyx_t_43) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __pyx_tuple__129 = PyTuple_Pack(18, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
+0719:                         channels=None,
    values[2] = ((PyObject *)((PyObject *)Py_None));
+0720:                         srate=None,
    values[3] = ((PyObject *)((PyObject *)Py_None));
+0721:                         sample_type = None,
    values[4] = ((PyObject *)((PyObject *)Py_None));
+0722:                         header_type = None,
    values[5] = ((PyObject *)((PyObject *)Py_None));
+0723:                         comment = False,
    values[6] = ((PyObject *)((PyObject *)Py_False));
+0724:                         verbose = False,
    values[7] = ((PyObject *)((PyObject *)Py_False));
+0725:                         reverb = None,
    values[8] = ((PyObject *)((PyObject *)Py_None));
+0726:                         revfile = None,
    values[9] = ((PyObject *)((PyObject *)Py_None));
+0727:                         reverb_data = None,
    values[10] = ((PyObject *)((PyObject *)Py_None));
+0728:                         reverb_channels = None,
    values[11] = ((PyObject *)((PyObject *)Py_None));
+0729:                         continue_old_file = False,
    values[12] = ((PyObject *)((PyObject *)Py_False));
+0730:                         statistics = None,
    values[13] = ((PyObject *)((PyObject *)Py_None));
+0731:                         scaled_to = False,
    values[14] = ((PyObject *)((PyObject *)Py_False));
+0732:                         scaled_by = False,
    values[15] = ((PyObject *)((PyObject *)Py_False));
+0733:                         play = None,
    values[16] = ((PyObject *)((PyObject *)Py_None));
+0734:                         clipped = None,
    values[17] = ((PyObject *)((PyObject *)Py_None));
+0735:                         finalize = None):
    values[18] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channels);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_srate);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sample_type);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_type);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comment);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose);
          if (value) { values[7] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverb);
          if (value) { values[8] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_revfile);
          if (value) { values[9] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverb_data);
          if (value) { values[10] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverb_channels);
          if (value) { values[11] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_continue_old_file);
          if (value) { values[12] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_statistics);
          if (value) { values[13] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scaled_to);
          if (value) { values[14] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scaled_by);
          if (value) { values[15] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_play);
          if (value) { values[16] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_clipped);
          if (value) { values[17] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_finalize);
          if (value) { values[18] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 718, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 19: values[18] = __Pyx_Arg_FASTCALL(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_output = values[1];
    __pyx_v_channels = values[2];
    __pyx_v_srate = values[3];
    __pyx_v_sample_type = values[4];
    __pyx_v_header_type = values[5];
    __pyx_v_comment = values[6];
    __pyx_v_verbose = values[7];
    __pyx_v_reverb = values[8];
    __pyx_v_revfile = values[9];
    __pyx_v_reverb_data = values[10];
    __pyx_v_reverb_channels = values[11];
    __pyx_v_continue_old_file = values[12];
    __pyx_v_statistics = values[13];
    __pyx_v_scaled_to = values[14];
    __pyx_v_scaled_by = values[15];
    __pyx_v_play = values[16];
    __pyx_v_clipped = values[17];
    __pyx_v_finalize = values[18];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 19, __pyx_nargs); __PYX_ERR(0, 718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_5Sound___init__(__pyx_self, __pyx_v_self, __pyx_v_output, __pyx_v_channels, __pyx_v_srate, __pyx_v_sample_type, __pyx_v_header_type, __pyx_v_comment, __pyx_v_verbose, __pyx_v_reverb, __pyx_v_revfile, __pyx_v_reverb_data, __pyx_v_reverb_channels, __pyx_v_continue_old_file, __pyx_v_statistics, __pyx_v_scaled_to, __pyx_v_scaled_by, __pyx_v_play, __pyx_v_clipped, __pyx_v_finalize);
+0736:         self.output = output if output is not None else CLM.file_name
  __pyx_t_2 = (__pyx_v_output != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_output);
    __pyx_t_1 = __pyx_v_output;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output, __pyx_t_1) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0737:         self.channels = channels if channels is not None else CLM.channels
  __pyx_t_2 = (__pyx_v_channels != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_channels);
    __pyx_t_1 = __pyx_v_channels;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_channels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_channels, __pyx_t_1) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0738:         self.srate = srate if srate is not None else CLM.srate
  __pyx_t_2 = (__pyx_v_srate != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_srate);
    __pyx_t_1 = __pyx_v_srate;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_srate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_srate, __pyx_t_1) < 0) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0739:         self.sample_type = sample_type if sample_type is not None else CLM.sample_type
  __pyx_t_2 = (__pyx_v_sample_type != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_sample_type);
    __pyx_t_1 = __pyx_v_sample_type;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sample_type, __pyx_t_1) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0740:         self.header_type = header_type if header_type is not None else  CLM.header_type
  __pyx_t_2 = (__pyx_v_header_type != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_header_type);
    __pyx_t_1 = __pyx_v_header_type;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_header_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header_type, __pyx_t_1) < 0) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0741:         self.comment = comment
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_comment, __pyx_v_comment) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
+0742:         self.verbose = verbose if verbose is not None else CLM.verbose
  __pyx_t_2 = (__pyx_v_verbose != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_verbose);
    __pyx_t_1 = __pyx_v_verbose;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_verbose); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_verbose, __pyx_t_1) < 0) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0743:         self.reverb = reverb
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reverb, __pyx_v_reverb) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
+0744:         self.revfile = revfile if revfile is not None else CLM.reverb_file_name
  __pyx_t_2 = (__pyx_v_revfile != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_revfile);
    __pyx_t_1 = __pyx_v_revfile;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverb_file_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_revfile, __pyx_t_1) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0745:         self.reverb_data = reverb_data if reverb_data is not None else CLM.reverb_data
  __pyx_t_2 = (__pyx_v_reverb_data != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_reverb_data);
    __pyx_t_1 = __pyx_v_reverb_data;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reverb_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reverb_data, __pyx_t_1) < 0) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0746:         self.reverb_channels = reverb_channels if reverb_channels is not None else CLM.reverb_channels
  __pyx_t_2 = (__pyx_v_reverb_channels != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_reverb_channels);
    __pyx_t_1 = __pyx_v_reverb_channels;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverb_channels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reverb_channels, __pyx_t_1) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0747:         self.continue_old_file = continue_old_file
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_continue_old_file, __pyx_v_continue_old_file) < 0) __PYX_ERR(0, 747, __pyx_L1_error)
+0748:         self.statistics = statistics if statistics is not None else CLM.statistics
  __pyx_t_2 = (__pyx_v_statistics != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_statistics);
    __pyx_t_1 = __pyx_v_statistics;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_statistics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_statistics, __pyx_t_1) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0749:         self.scaled_to = scaled_to
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scaled_to, __pyx_v_scaled_to) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
+0750:         self.scaled_by = scaled_by
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scaled_by, __pyx_v_scaled_by) < 0) __PYX_ERR(0, 750, __pyx_L1_error)
+0751:         self.play = play if play is not None else CLM.play
  __pyx_t_2 = (__pyx_v_play != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_play);
    __pyx_t_1 = __pyx_v_play;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_play); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_play, __pyx_t_1) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0752:         self.clipped = clipped if clipped is not None else CLM.clipped
  __pyx_t_2 = (__pyx_v_clipped != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_clipped);
    __pyx_t_1 = __pyx_v_clipped;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_clipped); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clipped, __pyx_t_1) < 0) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0753:         self.output_to_file = isinstance(self.output, str)
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyString_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0754:         self.reverb_to_file = self.reverb is not None and isinstance(self.output, str)
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyString_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reverb_to_file, __pyx_t_1) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0755:         self.old_srate = get_srate()
  __pyx_t_5 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
  __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_old_srate, __pyx_t_1) < 0) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0756:         self.finalize = finalize
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_finalize, __pyx_v_finalize) < 0) __PYX_ERR(0, 756, __pyx_L1_error)
 0757: 
+0758:     def __enter__(self):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_5Sound_3__enter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_5Sound_3__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_5Sound_3__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_5Sound_3__enter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__enter__") < 0)) __PYX_ERR(0, 758, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__enter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 758, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.Sound.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_5Sound_2__enter__(__pyx_self, __pyx_v_self);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_5Sound_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("pysndlib.clm.Sound.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_43 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_5Sound_3__enter__, 0, __pyx_n_s_Sound___enter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (__Pyx_SetNameInClass(__pyx_t_41, __pyx_n_s_enter, __pyx_t_43) < 0) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
/* … */
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_enter, 758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 758, __pyx_L1_error)
 0759: 
+0760:         if not self.clipped:
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clipped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {
/* … */
    goto __pyx_L3;
  }
+0761:             if (self.scaled_by or self.scaled_to) and (self.sample_type in [Sample.BFLOAT, Sample.LFLOAT, Sample.BDOUBLE, Sample.LDOUBLE]):
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_by); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_2) {
    } else {
      goto __pyx_L6_next_and;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_L6_next_and:;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Sample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_BFLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_6) {
    } else {
      __pyx_t_2 = __pyx_t_6;
      goto __pyx_L8_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Sample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LFLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_6) {
    } else {
      __pyx_t_2 = __pyx_t_6;
      goto __pyx_L8_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Sample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_BDOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_6) {
    } else {
      __pyx_t_2 = __pyx_t_6;
      goto __pyx_L8_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Sample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LDOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_6;
    __pyx_L8_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_2;
    __pyx_t_3 = __pyx_t_6;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_3) {
/* … */
      goto __pyx_L4;
    }
+0762:                 csndlib.mus_set_clipping(False)
      (void)(mus_set_clipping(0));
 0763:             else:
+0764:                 csndlib.mus_set_clipping(CLM.clipped)
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CLM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_clipped); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      (void)(mus_set_clipping(__pyx_t_3));
    }
    __pyx_L4:;
 0765:         else:
+0766:             csndlib.mus_set_clipping(self.clipped)
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clipped); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (void)(mus_set_clipping(__pyx_t_3));
  }
  __pyx_L3:;
 0767: 
+0768:         set_srate(self.srate)
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_srate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __pyx_f_8pysndlib_3clm_set_srate(__pyx_t_7, 0); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 768, __pyx_L1_error)
 0769: 
 0770:         # in original why use reverb-1?
+0771:         if  self.statistics :
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_statistics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {
/* … */
  }
+0772:             self.tic = time.perf_counter()
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[1] = {__pyx_t_1, };
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tic, __pyx_t_4) < 0) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 0773: 
+0774:         if self.output_to_file :
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {
/* … */
    goto __pyx_L13;
  }
+0775:             if self.continue_old_file:
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_continue_old_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
/* … */
      goto __pyx_L14;
    }
+0776:                 CLM.output = continue_sample2file(self.filename)
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filename); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 776, __pyx_L1_error)
      __pyx_t_5 = ((PyObject *)__pyx_f_8pysndlib_3clm_continue_sample2file(((PyObject*)__pyx_t_4), 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_output, __pyx_t_5) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0777:                 set_srate(csndlib.mus_sound_srate(self.filename)) # maybe print warning or at least note 
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filename); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L1_error)
      __pyx_t_8 = __pyx_f_8pysndlib_3clm_set_srate(mus_sound_srate(__pyx_t_10), 0); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 0778:             else:
+0779:                 CLM.output = make_sample2file(self.output,self.channels, sample_type=self.sample_type , header_type=self.header_type)
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_channels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13.__pyx_n = 3;
      __pyx_t_13.chans = __pyx_t_5;
      __pyx_t_13.sample_type = __pyx_t_1;
      __pyx_t_13.header_type = __pyx_t_11;
      __pyx_t_12 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_sample2file(__pyx_t_4, 0, &__pyx_t_13)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_CLM); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_n_s_output, __pyx_t_12) < 0) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_L14:;
+0780:         elif is_list_or_ndarray(self.output):
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_t_11, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (likely(__pyx_t_3)) {
/* … */
    goto __pyx_L13;
  }
+0781:             CLM.output = self.output
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_CLM); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_n_s_output, __pyx_t_12) < 0) __PYX_ERR(0, 781, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 0782:         else:
+0783:             raise TypeError(f"writing to  {type(self.output)} not supported")
  /*else*/ {
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_14 = 0;
    __pyx_t_15 = 127;
    __Pyx_INCREF(__pyx_kp_u_writing_to);
    __pyx_t_14 += 12;
    __Pyx_GIVEREF(__pyx_kp_u_writing_to);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_writing_to);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_t_12)), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_not_supported);
    __pyx_t_14 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_not_supported);
    PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_kp_u_not_supported);
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_11, 3, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_11, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_ERR(0, 783, __pyx_L1_error)
  }
  __pyx_L13:;
 0784: 
+0785:         if self.reverb_to_file:
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_to_file); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_3) {
/* … */
  }
+0786:             if self.continue_old_file:
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_continue_old_file); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_3) {
/* … */
      goto __pyx_L16;
    }
+0787:                 CLM.reverb = continue_sample2file(self.revfile)
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_revfile); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (!(likely(PyString_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_11))) __PYX_ERR(0, 787, __pyx_L1_error)
      __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_continue_sample2file(((PyObject*)__pyx_t_11), 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_CLM); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_n_s_reverb, __pyx_t_1) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 0788:             else:
+0789:                 CLM.reverb = make_sample2file(self.revfile,self.reverb_channels, sample_type=self.sample_type , header_type=self.header_type)
    /*else*/ {
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_revfile); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_channels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13.__pyx_n = 3;
      __pyx_t_13.chans = __pyx_t_1;
      __pyx_t_13.sample_type = __pyx_t_12;
      __pyx_t_13.header_type = __pyx_t_5;
      __pyx_t_4 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_sample2file(__pyx_t_11, 0, &__pyx_t_13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_reverb, __pyx_t_4) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L16:;
 0790: 
+0791:         if self.reverb and not self.reverb_to_file and is_list_or_ndarray(self.output):
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_to_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (!__pyx_t_6);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_2;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_3) {
/* … */
  }
+0792:             CLM.reverb = np.zeros((self.reverb_channels, np.shape(CLM.output)[1]), dtype=CLM.output.dtype)
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_channels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CLM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_output); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_16};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
    __pyx_t_4 = 0;
    __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_output); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_CLM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_12, __pyx_n_s_reverb, __pyx_t_4) < 0) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
 0793: 
+0794:         return self
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;
 0795: 
+0796:     def __exit__(self, *args):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_5Sound_5__exit__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_5Sound_5__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_5Sound_5__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_5Sound_5__exit__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs);
  if (unlikely(!__pyx_v_args)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_v_args);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        default:
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__exit__") < 0)) __PYX_ERR(0, 796, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 796, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("pysndlib.clm.Sound.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_5Sound_4__exit__(__pyx_self, __pyx_v_self, __pyx_v_args);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_5Sound_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  __Pyx_memviewslice __pyx_v_vals_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_times_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_toc = NULL;
  PyObject *__pyx_v_statstr = NULL;
  PyObject *__pyx_v_chans = NULL;
  PyObject *__pyx_v_vals = NULL;
  PyObject *__pyx_v_times = NULL;
  CYTHON_UNUSED mus_long_t __pyx_v_maxamp;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_mabs = NULL;
  PyObject *__pyx_v_arr = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("pysndlib.clm.Sound.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_vals_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_times_view, 1);
  __Pyx_XDECREF(__pyx_v_toc);
  __Pyx_XDECREF(__pyx_v_statstr);
  __Pyx_XDECREF(__pyx_v_chans);
  __Pyx_XDECREF(__pyx_v_vals);
  __Pyx_XDECREF(__pyx_v_times);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_mabs);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__132 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_vals_view, __pyx_n_s_times_view, __pyx_n_s_toc, __pyx_n_s_statstr, __pyx_n_s_chans, __pyx_n_s_vals, __pyx_n_s_times, __pyx_n_s_maxamp_3, __pyx_n_s_i, __pyx_n_s_mabs, __pyx_n_s_arr, __pyx_n_s__131); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
/* … */
  __pyx_t_43 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_5Sound_5__exit__, 0, __pyx_n_s_Sound___exit, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_43);
  if (__Pyx_SetNameInClass(__pyx_t_41, __pyx_n_s_exit, __pyx_t_43) < 0) __PYX_ERR(0, 796, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_exit, 796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 796, __pyx_L1_error)
+0797:         cdef cclm.mus_float_t [:] vals_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 797, __pyx_L1_error)
  __pyx_v_vals_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
+0798:         cdef cclm.mus_long_t [:] times_view = None
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_long_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 798, __pyx_L1_error)
  __pyx_v_times_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+0799:         if self.reverb:
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
/* … */
  }
+0800:             if self.reverb_to_file:
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_to_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 800, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {
/* … */
    }
+0801:                 mus_close(CLM.reverb)
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 801, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8pysndlib_3clm_mus_any))))) __PYX_ERR(0, 801, __pyx_L1_error)
      __pyx_t_6 = __pyx_f_8pysndlib_3clm_mus_close(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_5), 0); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0802:                 CLM.reverb = make_file2sample(self.revfile)
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_revfile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_file2sample(__pyx_t_5, 0, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_reverb, __pyx_t_3) < 0) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 0803: 
+0804:                 if self.reverb_data:
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 804, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {
/* … */
        goto __pyx_L5;
      }
+0805:                     self.reverb(**self.reverb_data)
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(__pyx_t_7 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          __PYX_ERR(0, 805, __pyx_L1_error)
        }
        if (likely(PyDict_CheckExact(__pyx_t_7))) {
          __pyx_t_3 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 0806:                 else:
+0807:                     self.reverb()
      /*else*/ {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_5, };
          __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 807, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L5:;
+0808:                 mus_close(CLM.reverb)
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CLM); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reverb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8pysndlib_3clm_mus_any))))) __PYX_ERR(0, 808, __pyx_L1_error)
      __pyx_t_6 = __pyx_f_8pysndlib_3clm_mus_close(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3), 0); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0809: 
+0810:             if is_list_or_ndarray(CLM.reverb):
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverb); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {
/* … */
    }
+0811:                 if self.reverb_data:
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {
/* … */
        goto __pyx_L7;
      }
+0812:                     self.reverb(**self.reverb_data)
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__pyx_t_5 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          __PYX_ERR(0, 812, __pyx_L1_error)
        }
        if (likely(PyDict_CheckExact(__pyx_t_5))) {
          __pyx_t_7 = PyDict_Copy(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 0813:                 else:
+0814:                     self.reverb()
      /*else*/ {
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 814, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_3, };
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_L7:;
 0815: 
+0816:         if self.output_to_file:
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {
/* … */
  }
+0817:             mus_close(CLM.output)
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8pysndlib_3clm_mus_any))))) __PYX_ERR(0, 817, __pyx_L1_error)
    __pyx_t_6 = __pyx_f_8pysndlib_3clm_mus_close(((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_7), 0); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 0818: 
 0819: 
+0820:         if  self.statistics :
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_statistics); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_4) {
/* … */
  }
+0821:             toc = time.perf_counter()
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[1] = {__pyx_t_5, };
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_toc = __pyx_t_7;
    __pyx_t_7 = 0;
 0822: 
+0823:             statstr = ''
    __Pyx_INCREF(__pyx_kp_s_);
    __pyx_v_statstr = __pyx_kp_s_;
+0824:             if isinstance(self.output, str):
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyString_Check(__pyx_t_7); 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
/* … */
    }
+0825:                 statstr = f"{self.output}: "
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_3, __pyx_kp_u__4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_7);
      __pyx_t_7 = 0;
+0826:             if self.output_to_file:
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
/* … */
      goto __pyx_L11;
    }
+0827:                     chans = clm_channels(self.output)
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_v_chans = __pyx_t_7;
      __pyx_t_7 = 0;
+0828:                     vals = np.zeros(chans, dtype=np.double)
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chans);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_vals = __pyx_t_9;
      __pyx_t_9 = 0;
+0829:                     times = np.zeros(chans, dtype=np.int64)
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_chans);
      __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_times = __pyx_t_8;
      __pyx_t_8 = 0;
+0830:                     vals_view = vals
      __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(__pyx_v_vals, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 830, __pyx_L1_error)
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_vals_view, 1);
      __pyx_v_vals_view = __pyx_t_1;
      __pyx_t_1.memview = NULL;
      __pyx_t_1.data = NULL;
+0831:                     times_view = times
      __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_long_t(__pyx_v_times, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 831, __pyx_L1_error)
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_times_view, 1);
      __pyx_v_times_view = __pyx_t_2;
      __pyx_t_2.memview = NULL;
      __pyx_t_2.data = NULL;
+0832:                     maxamp = csndlib.mus_sound_maxamps(self.output, chans, &vals_view[0], &times_view[0])
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
      __pyx_t_11 = 0;
      __pyx_t_12 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_v_vals_view.shape[0];
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_v_vals_view.shape[0])) __pyx_t_12 = 0;
      if (unlikely(__pyx_t_12 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_12);
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_t_13 = 0;
      __pyx_t_12 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_v_times_view.shape[0];
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_v_times_view.shape[0])) __pyx_t_12 = 0;
      if (unlikely(__pyx_t_12 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_12);
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_v_maxamp = mus_sound_maxamps(__pyx_t_10, __pyx_t_6, (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_vals_view.data + __pyx_t_11 * __pyx_v_vals_view.strides[0]) )))), (&(*((mus_long_t *) ( /* dim=0 */ (__pyx_v_times_view.data + __pyx_t_13 * __pyx_v_times_view.strides[0]) )))));
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+0833:                     statstr += f": maxamp: {vals} {times} "
      __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_14 = 0;
      __pyx_t_15 = 127;
      __Pyx_INCREF(__pyx_kp_u_maxamp);
      __pyx_t_14 += 10;
      __Pyx_GIVEREF(__pyx_kp_u_maxamp);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_maxamp);
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_vals, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_14 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u__17);
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_times, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_14 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_kp_u__17);
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_8, 5, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_statstr, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_8);
      __pyx_t_8 = 0;
 0834:             else:
+0835:                 chans = clm_channels(self.output)
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 835, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_v_chans = __pyx_t_8;
      __pyx_t_8 = 0;
+0836:                 vals = np.zeros(chans, dtype=np.double)
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_chans);
      __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_vals = __pyx_t_3;
      __pyx_t_3 = 0;
+0837:                 times = np.zeros(chans, dtype=np.int64)
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chans);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_times = __pyx_t_5;
      __pyx_t_5 = 0;
+0838:                 for i in range(chans):
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_chans); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8); __pyx_t_14 = 0;
        __pyx_t_16 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 838, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 838, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_16)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 838, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 838, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_16(__pyx_t_8);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 838, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
        __pyx_t_5 = 0;
/* … */
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+0839:                     mabs = np.abs(self.output[i])
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_mabs, __pyx_t_5);
        __pyx_t_5 = 0;
+0840:                     vals[i] = np.amax(mabs)
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_amax); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_mabs};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        if (unlikely((PyObject_SetItem(__pyx_v_vals, __pyx_v_i, __pyx_t_5) < 0))) __PYX_ERR(0, 840, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0841:                     times[i] = np.argmax(mabs)
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_argmax); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_mabs};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        if (unlikely((PyObject_SetItem(__pyx_v_times, __pyx_v_i, __pyx_t_5) < 0))) __PYX_ERR(0, 841, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0842:                 statstr += f"maxamp: {vals} {times} "
      __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_14 = 0;
      __pyx_t_15 = 127;
      __Pyx_INCREF(__pyx_kp_u_maxamp_2);
      __pyx_t_14 += 8;
      __Pyx_GIVEREF(__pyx_kp_u_maxamp_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_maxamp_2);
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_vals, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_14 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u__17);
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_times, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_14 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_kp_u__17);
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 5, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_statstr, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __pyx_L11:;
 0843: 
 0844: 
+0845:             if self.scaled_by or self.scaled_to:
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_by); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!__pyx_t_17) {
    } else {
      __pyx_t_4 = __pyx_t_17;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_to); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_4 = __pyx_t_17;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_4) {
/* … */
    }
+0846:                 statstr += "(before scaling) "
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_statstr, __pyx_kp_s_before_scaling); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_8);
      __pyx_t_8 = 0;
 0847: 
+0848:             statstr += f"compute time: {toc - self.tic:0.8f} seconds. "
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = 0;
    __pyx_t_15 = 127;
    __Pyx_INCREF(__pyx_kp_u_compute_time);
    __pyx_t_14 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_compute_time);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_compute_time);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyNumber_Subtract(__pyx_v_toc, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_9, __pyx_kp_u_0_8f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u_seconds);
    __pyx_t_14 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_seconds);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u_seconds);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_statstr, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_8);
    __pyx_t_8 = 0;
 0849: 
 0850: 
+0851:             if self.reverb_to_file:
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_to_file); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {
/* … */
      goto __pyx_L18;
    }
+0852:                     chans = clm_channels(self.revfile)
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 852, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_revfile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 852, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 852, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_chans, __pyx_t_8);
      __pyx_t_8 = 0;
+0853:                     vals = np.zeros(chans, dtype=np.double)
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_chans);
      __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_vals, __pyx_t_3);
      __pyx_t_3 = 0;
+0854:                     times = np.zeros(chans, dtype=np.int_)
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chans);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_times, __pyx_t_7);
      __pyx_t_7 = 0;
+0855:                     vals_view = vals
      __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(__pyx_v_vals, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_vals_view, 1);
      __pyx_v_vals_view = __pyx_t_1;
      __pyx_t_1.memview = NULL;
      __pyx_t_1.data = NULL;
+0856:                     times_view = times
      __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_long_t(__pyx_v_times, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 856, __pyx_L1_error)
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_times_view, 1);
      __pyx_v_times_view = __pyx_t_2;
      __pyx_t_2.memview = NULL;
      __pyx_t_2.data = NULL;
+0857:                     maxamp = csndlib.mus_sound_maxamps(self.revfile, chans, &vals_view[0], &times_view[0])
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_revfile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 857, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 857, __pyx_L1_error)
      __pyx_t_13 = 0;
      __pyx_t_12 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_v_vals_view.shape[0];
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_v_vals_view.shape[0])) __pyx_t_12 = 0;
      if (unlikely(__pyx_t_12 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_12);
        __PYX_ERR(0, 857, __pyx_L1_error)
      }
      __pyx_t_11 = 0;
      __pyx_t_12 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_v_times_view.shape[0];
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_v_times_view.shape[0])) __pyx_t_12 = 0;
      if (unlikely(__pyx_t_12 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_12);
        __PYX_ERR(0, 857, __pyx_L1_error)
      }
      __pyx_v_maxamp = mus_sound_maxamps(__pyx_t_10, __pyx_t_6, (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_vals_view.data + __pyx_t_13 * __pyx_v_vals_view.strides[0]) )))), (&(*((mus_long_t *) ( /* dim=0 */ (__pyx_v_times_view.data + __pyx_t_11 * __pyx_v_times_view.strides[0]) )))));
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+0858:                     statstr += f"revmax: {vals} {times}"
      __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_14 = 0;
      __pyx_t_15 = 127;
      __Pyx_INCREF(__pyx_kp_u_revmax);
      __pyx_t_14 += 8;
      __Pyx_GIVEREF(__pyx_kp_u_revmax);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_revmax);
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_vals, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_14 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__17);
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_times, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_statstr, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_7);
      __pyx_t_7 = 0;
+0859:             elif self.reverb and not self.reverb_to_file and is_list_or_ndarray(self.output):
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_17) {
    } else {
      __pyx_t_4 = __pyx_t_17;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reverb_to_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_18 = (!__pyx_t_17);
    if (__pyx_t_18) {
    } else {
      __pyx_t_4 = __pyx_t_18;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_t_7, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 859, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_4 = __pyx_t_18;
    __pyx_L19_bool_binop_done:;
    if (__pyx_t_4) {
/* … */
    }
    __pyx_L18:;
+0860:                 chans = clm_channels(CLM.reverb)
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverb); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_chans, __pyx_t_8);
      __pyx_t_8 = 0;
 0861: 
+0862:                 vals = np.zeros(chans, dtype=np.double)
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_chans);
      __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_vals, __pyx_t_5);
      __pyx_t_5 = 0;
+0863:                 times = np.zeros(chans, dtype=np.int_)
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_chans);
      __Pyx_GIVEREF(__pyx_v_chans);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chans);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_times, __pyx_t_3);
      __pyx_t_3 = 0;
+0864:                 for i in range(chans):
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_chans); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_14 = 0;
        __pyx_t_16 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 864, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 864, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_16)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 864, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 864, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_16(__pyx_t_8);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 864, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
        __pyx_t_3 = 0;
/* … */
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+0865:                     mabs = np.abs(CLM.reverb[i])
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_abs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reverb); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_mabs, __pyx_t_3);
        __pyx_t_3 = 0;
+0866:                     vals[i] = np.amax(mabs)
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_amax); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_mabs};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        if (unlikely((PyObject_SetItem(__pyx_v_vals, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0867:                     times[i] = np.argmax(mabs)
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_argmax); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_mabs};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        if (unlikely((PyObject_SetItem(__pyx_v_times, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 867, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0868:                 statstr += f"revmax: {vals} {times}"
      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_14 = 0;
      __pyx_t_15 = 127;
      __Pyx_INCREF(__pyx_kp_u_revmax);
      __pyx_t_14 += 8;
      __Pyx_GIVEREF(__pyx_kp_u_revmax);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_revmax);
      __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_vals, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__17);
      __pyx_t_14 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__17);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u__17);
      __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_times, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_15;
      __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_statstr, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_statstr, __pyx_t_8);
      __pyx_t_8 = 0;
 0869: 
+0870:             print(statstr)
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_statstr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 0871: 
+0872:         if self.scaled_to:
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_to); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_4) {
/* … */
    goto __pyx_L25;
  }
+0873:             if self.output_to_file:
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {
/* … */
      goto __pyx_L26;
    }
+0874:                 arr, _ = file2ndarray(self.output)
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(PyString_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 874, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_8pysndlib_3clm_file2ndarray(((PyObject*)__pyx_t_8), 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 874, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
        index = 0; __pyx_t_8 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L27_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_19(__pyx_t_5); if (unlikely(!__pyx_t_9)) goto __pyx_L27_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_5), 2) < 0) __PYX_ERR(0, 874, __pyx_L1_error)
        __pyx_t_19 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L28_unpacking_done;
        __pyx_L27_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_19 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 874, __pyx_L1_error)
        __pyx_L28_unpacking_done:;
      }
      __pyx_v_arr = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_v__ = __pyx_t_9;
      __pyx_t_9 = 0;
+0875:                 arr *= (self.scaled_to / np.max(np.abs(arr)))
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_to); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_abs); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_arr};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
      __pyx_t_20 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_8};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 875, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_InPlaceMultiply(__pyx_v_arr, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_9);
      __pyx_t_9 = 0;
 0876:                 # handle error
+0877:                 ndarray2file(self.output, arr)
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(PyString_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 877, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_8pysndlib_3clm_ndarray2file(((PyObject*)__pyx_t_9), __pyx_v_arr, 0, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 0878:             else:
+0879:                 self.output *= (self.scaled_to / np.max(np.abs(self.output)))
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_to); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_max); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_abs); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_22 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
        __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_21);
        if (likely(__pyx_t_22)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
          __Pyx_INCREF(__pyx_t_22);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_21, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_22, __pyx_t_7};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      }
      __pyx_t_21 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_21)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_21);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
      __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output, __pyx_t_3) < 0) __PYX_ERR(0, 879, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L26:;
+0880:         elif self.scaled_by:
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_by); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
/* … */
  }
  __pyx_L25:;
+0881:             if self.output_to_file:
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {
/* … */
      goto __pyx_L29;
    }
+0882:                 arr, _ = file2ndarray(self.output)
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 882, __pyx_L1_error)
      __pyx_t_20 = __pyx_f_8pysndlib_3clm_file2ndarray(((PyObject*)__pyx_t_3), 0, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_20))) || (PyList_CheckExact(__pyx_t_20))) {
        PyObject* sequence = __pyx_t_20;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 882, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
        index = 0; __pyx_t_3 = __pyx_t_19(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L30_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_5 = __pyx_t_19(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L30_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_9), 2) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
        __pyx_t_19 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L31_unpacking_done;
        __pyx_L30_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_19 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 882, __pyx_L1_error)
        __pyx_L31_unpacking_done:;
      }
      __pyx_v_arr = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_v__ = __pyx_t_5;
      __pyx_t_5 = 0;
+0883:                 arr *= self.scaled_by
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_by); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_arr, __pyx_t_20); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_5);
      __pyx_t_5 = 0;
+0884:                 ndarray2file(self.output, arr)
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 884, __pyx_L1_error)
      __pyx_t_20 = __pyx_f_8pysndlib_3clm_ndarray2file(((PyObject*)__pyx_t_5), __pyx_v_arr, 0, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 884, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
 0885:             else:
+0886:                 self.output *= self.scaled_by
    /*else*/ {
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scaled_by); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_20, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_output, __pyx_t_3) < 0) __PYX_ERR(0, 886, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L29:;
 0887: 
+0888:         if self.play and self.output_to_file:
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_play); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_18) {
  } else {
    __pyx_t_4 = __pyx_t_18;
    goto __pyx_L33_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output_to_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_18;
  __pyx_L33_bool_binop_done:;
  if (__pyx_t_4) {
/* … */
  }
+0889:             subprocess.run([CLM.player,self.output])
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_run); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_player); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
    __pyx_t_9 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_20);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_20, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0890:         # need some safety if errors
 0891: 
+0892:         set_srate(self.old_srate)
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_old_srate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_24 = __pyx_f_8pysndlib_3clm_set_srate(__pyx_t_23, 0); if (unlikely(__pyx_t_24 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L1_error)
 0893: 
+0894:         if self.finalize:
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_finalize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
/* … */
  }
+0895:             self.finalize(self.output)
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_finalize); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_output); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_20);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_20, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0896: 
 0897: 
+0898: cpdef is_list_or_ndarray(x):
static PyObject *__pyx_pw_8pysndlib_3clm_11is_list_or_ndarray(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_list_or_ndarray(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_list_or_ndarray", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.is_list_or_ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_11is_list_or_ndarray(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_11is_list_or_ndarray = {"is_list_or_ndarray", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_11is_list_or_ndarray, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_11is_list_or_ndarray(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_list_or_ndarray (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_list_or_ndarray") < 0)) __PYX_ERR(0, 898, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_list_or_ndarray", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 898, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_list_or_ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_10is_list_or_ndarray(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_10is_list_or_ndarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_list_or_ndarray", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_list_or_ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_11is_list_or_ndarray, 0, __pyx_n_s_is_list_or_ndarray, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_list_or_ndarray, __pyx_t_40) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_list_or_ndarray, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 898, __pyx_L1_error)
+0899:     return isinstance(x, list) or isinstance(x, np.ndarray)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_Check(__pyx_v_x); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_x, __pyx_ptype_5numpy_ndarray); 
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0900: 
+0901: cpdef is_power_of_2(x):
static PyObject *__pyx_pw_8pysndlib_3clm_13is_power_of_2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_power_of_2(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_power_of_2", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_power_of_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_13is_power_of_2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_13is_power_of_2 = {"is_power_of_2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_13is_power_of_2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_13is_power_of_2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_power_of_2 (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_power_of_2") < 0)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_power_of_2", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 901, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_power_of_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_12is_power_of_2(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_12is_power_of_2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_power_of_2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_power_of_2(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_power_of_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_13is_power_of_2, 0, __pyx_n_s_is_power_of_2, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_power_of_2, __pyx_t_40) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_power_of_2, 901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 901, __pyx_L1_error)
+0902:     return (((x) - 1) & (x)) == 0
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0903: 
+0904: cpdef next_power_of_2(x):
static PyObject *__pyx_pw_8pysndlib_3clm_15next_power_of_2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_next_power_of_2(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_power_of_2", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.next_power_of_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_15next_power_of_2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_15next_power_of_2 = {"next_power_of_2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_15next_power_of_2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_15next_power_of_2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_power_of_2 (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "next_power_of_2") < 0)) __PYX_ERR(0, 904, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("next_power_of_2", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 904, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.next_power_of_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_14next_power_of_2(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_14next_power_of_2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next_power_of_2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_next_power_of_2(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.next_power_of_2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_15next_power_of_2, 0, __pyx_n_s_next_power_of_2, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_next_power_of_2, __pyx_t_40) < 0) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_next_power_of_2, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 904, __pyx_L1_error)
+0905:     return 2**int(1 + (float(math.log(x + 1)) / math.log(2.0)))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_x, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_float_2_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0906: 
 0907: 
 0908: 
+0909: cpdef np.ndarray to_partials(harms):
static PyObject *__pyx_pw_8pysndlib_3clm_17to_partials(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_to_partials(PyObject *__pyx_v_harms, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_maxpartial = NULL;
  PyObject *__pyx_v_partials = NULL;
  PyObject *__pyx_v_i = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_partials", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysndlib.clm.to_partials", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_maxpartial);
  __Pyx_XDECREF(__pyx_v_partials);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_17to_partials(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_17to_partials = {"to_partials", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_17to_partials, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_17to_partials(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_harms = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_partials (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_harms,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_harms)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 909, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_partials") < 0)) __PYX_ERR(0, 909, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_harms = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_partials", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 909, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.to_partials", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_16to_partials(__pyx_self, __pyx_v_harms);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_16to_partials(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_harms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_partials", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_to_partials(__pyx_v_harms, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.to_partials", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_harms); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_17to_partials, 0, __pyx_n_s_to_partials, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_partials, __pyx_t_40) < 0) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_to_partials, 909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 909, __pyx_L1_error)
+0910:     if isinstance(harms, list):
  __pyx_t_1 = PyList_Check(__pyx_v_harms); 
  if (__pyx_t_1) {
/* … */
  }
+0911:         p = harms[::2]
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_harms, __pyx_slice__20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_p = __pyx_t_2;
    __pyx_t_2 = 0;
/* … */
  __pyx_slice__20 = PySlice_New(Py_None, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__20);
  __Pyx_GIVEREF(__pyx_slice__20);
+0912:         maxpartial = max(p)
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_maxpartial = __pyx_t_2;
    __pyx_t_2 = 0;
+0913:         partials = [0.0] * int(maxpartial+1)
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_maxpartial, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_float_0_0);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_float_0_0);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_temp;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_partials = __pyx_t_2;
    __pyx_t_2 = 0;
+0914:         check_ndim(partials)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_partials};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0915:         for i in range(0, len(harms),2):
    __pyx_t_6 = PyObject_Length(__pyx_v_harms); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 915, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 915, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 915, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 915, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 915, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;
/* … */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0916:             partials[int(harms[i])] = harms[i+1]
      __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_harms, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_harms, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely((PyObject_SetItem(__pyx_v_partials, __pyx_t_8, __pyx_t_4) < 0))) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0917:         return partials
    __Pyx_XDECREF((PyObject *)__pyx_r);
    if (!(likely(__Pyx_TypeTest(__pyx_v_partials, __pyx_ptype_5numpy_ndarray)))) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_partials);
    __pyx_r = ((PyArrayObject *)__pyx_v_partials);
    goto __pyx_L0;
+0918:     elif isinstance(harms[0], np.double):
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_harms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_t_3, __pyx_t_8); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (likely(__pyx_t_1)) {
/* … */
  }
+0919:         p = harms[::2]
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_harms, __pyx_slice__20); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_p = __pyx_t_8;
    __pyx_t_8 = 0;
+0920:         maxpartial = np.max(p)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_p};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_maxpartial = __pyx_t_8;
    __pyx_t_8 = 0;
+0921:         partials = np.zeros(int(maxpartial)+1, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_maxpartial); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_partials = __pyx_t_9;
    __pyx_t_9 = 0;
+0922:         check_ndim(partials)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_partials};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+0923:         for i in range(0, len(harms),2):
    __pyx_t_6 = PyObject_Length(__pyx_v_harms); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 923, __pyx_L1_error)
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_2);
    __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_3 = __pyx_t_9; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 923, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 923, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 923, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 923, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 923, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 923, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
      __pyx_t_9 = 0;
/* … */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0924:             partials[int(harms[i])] = harms[i+1]
      __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_harms, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_harms, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely((PyObject_SetItem(__pyx_v_partials, __pyx_t_4, __pyx_t_8) < 0))) __PYX_ERR(0, 924, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+0925:         return partials
    __Pyx_XDECREF((PyObject *)__pyx_r);
    if (!(likely(((__pyx_v_partials) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_partials, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_partials);
    __pyx_r = ((PyArrayObject *)__pyx_v_partials);
    goto __pyx_L0;
 0926:     else:
+0927:         raise TypeError(f'{type(harms)} cannot be converted to a mus_float_array')
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_harms)), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_3, __pyx_kp_u_cannot_be_converted_to_a_mus_fl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 927, __pyx_L1_error)
  }
 0928: 
 0929: 
 0930: # --------------- generic functions ---------------- #
 0931: 
+0932: cpdef int mus_close(obj: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_19mus_close(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_mus_close(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_close", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_19mus_close(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_19mus_close = {"mus_close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_19mus_close, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_19mus_close(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_close (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mus_close") < 0)) __PYX_ERR(0, 932, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_obj = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mus_close", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 932, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "obj", 0))) __PYX_ERR(0, 932, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_18mus_close(__pyx_self, __pyx_v_obj);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_18mus_close(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_close", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_mus_close(__pyx_v_obj, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.mus_close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_obj, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 932, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_19mus_close, 0, __pyx_n_s_mus_close, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mus_close, __pyx_t_37) < 0) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_mus_close, 932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 932, __pyx_L1_error)
+0933:     return cclm.mus_close_file(obj._ptr)
  __pyx_r = mus_close_file(__pyx_v_obj->_ptr);
  goto __pyx_L0;
 0934: 
+0935: cpdef bint mus_is_output(obj: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_21mus_is_output(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_mus_is_output(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_is_output", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_21mus_is_output(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_20mus_is_output, "\n    returns True if gen is a type of output\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_21mus_is_output = {"mus_is_output", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_21mus_is_output, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_20mus_is_output};
static PyObject *__pyx_pw_8pysndlib_3clm_21mus_is_output(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_is_output (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mus_is_output") < 0)) __PYX_ERR(0, 935, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_obj = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mus_is_output", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 935, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_is_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "obj", 0))) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_20mus_is_output(__pyx_self, __pyx_v_obj);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_20mus_is_output(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_is_output", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_mus_is_output(__pyx_v_obj, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.mus_is_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_obj, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_21mus_is_output, 0, __pyx_n_s_mus_is_output, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mus_is_output, __pyx_t_40) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_mus_is_output, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 935, __pyx_L1_error)
 0936:     """
 0937:     returns True if gen is a type of output
 0938:     """
+0939:     return cclm.mus_is_output(obj._ptr)
  __pyx_r = mus_is_output(__pyx_v_obj->_ptr);
  goto __pyx_L0;
 0940: 
+0941: cpdef bint mus_is_input(obj: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_23mus_is_input(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_mus_is_input(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_is_input", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_23mus_is_input(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_22mus_is_input, "\n    returns True if gen is a type of output\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_23mus_is_input = {"mus_is_input", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_23mus_is_input, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_22mus_is_input};
static PyObject *__pyx_pw_8pysndlib_3clm_23mus_is_input(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_is_input (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mus_is_input") < 0)) __PYX_ERR(0, 941, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_obj = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mus_is_input", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 941, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_is_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "obj", 0))) __PYX_ERR(0, 941, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_22mus_is_input(__pyx_self, __pyx_v_obj);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_22mus_is_input(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_is_input", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_mus_is_input(__pyx_v_obj, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.mus_is_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_obj, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_23mus_is_input, 0, __pyx_n_s_mus_is_input, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mus_is_input, __pyx_t_37) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_mus_is_input, 941, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 941, __pyx_L1_error)
 0942:     """
 0943:     returns True if gen is a type of output
 0944:     """
+0945:     return cclm.mus_is_input(obj._ptr)
  __pyx_r = mus_is_input(__pyx_v_obj->_ptr);
  goto __pyx_L0;
 0946: 
 0947: 
 0948: # prepending clm to functions to avoid name clashes
 0949: 
 0950: # --------------- clm_length ---------------- #
+0951: @singledispatch
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_25clm_length(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_25clm_length = {"clm_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_25clm_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_25clm_length(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_length (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clm_length") < 0)) __PYX_ERR(0, 951, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clm_length", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 951, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.clm_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_24clm_length(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_24clm_length(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_length", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_25clm_length, 0, __pyx_n_s_clm_length, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_40); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clm_length, __pyx_t_41) < 0) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clm_length, 951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 951, __pyx_L1_error)
 0952: def clm_length(x):
 0953:     pass
 0954: 
+0955: @clm_length.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_27_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_27_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_27_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_27_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 955, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 955, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyString_Type), 0, "x", 1))) __PYX_ERR(0, 956, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_26_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_26_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_clm_length); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 955, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_27_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_37); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 955, __pyx_L1_error)
 0956: def _(x: str):# assume file
+0957:     return csndlib.mus_sound_length(x)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_x); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(mus_sound_length(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 0958: 
+0959: @clm_length.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_29_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_29_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_29_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_29_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 959, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 959, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "x", 0))) __PYX_ERR(0, 960, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_28_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_28_(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_clm_length); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_29_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_40); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 959, __pyx_L1_error)
 0960: def _(x: mus_any):# assume gen
+0961:     return x.mus_length
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_mus_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0962: 
+0963: @clm_length.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_31_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_31_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_31_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_31_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 963, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 963, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyList_Type), 0, "x", 1))) __PYX_ERR(0, 964, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_30_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_30_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_clm_length); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_n_s_list) < 0) __PYX_ERR(0, 963, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_31_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_37); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 963, __pyx_L1_error)
 0964: def _(x: list):
+0965:     if isinstance(x[0], list):
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
/* … */
  }
+0966:         return len(x[0])
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
 0967:     else:
+0968:         return len(x)
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_x); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 968, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
 0969: 
+0970: @clm_length.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_33_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_33_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_33_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_33_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 970, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 970, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 0, "x", 0))) __PYX_ERR(0, 971, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_32_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_32_(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_clm_length); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_kp_s_np_ndarray) < 0) __PYX_ERR(0, 970, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_33_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_40); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 970, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 970, __pyx_L1_error)
 0971: def _(x: np.ndarray):
+0972:     if x.ndim == 1:
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 1);
  if (__pyx_t_2) {
/* … */
  }
+0973:         return np.shape(x)[0]
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
+0974:     elif x.ndim == 2:
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 974, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 2);
  if (likely(__pyx_t_2)) {
/* … */
  }
+0975:         return np.shape(x)[1]
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_x)};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
 0976:     else:
+0977:         raise RuntimeError(f'ndarray must have 1 or 2 dimensions not {x.ndim}. ')
  /*else*/ {
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    __pyx_t_6 += 40;
    __Pyx_GIVEREF(__pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_t_1, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__13);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__13);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__13);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 977, __pyx_L1_error)
  }
 0978: 
 0979: 
 0980: 
 0981: # --------------- clm_channels ---------------- #
+0982: @singledispatch
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_35clm_channels(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_35clm_channels = {"clm_channels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_35clm_channels, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_35clm_channels(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_channels (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clm_channels") < 0)) __PYX_ERR(0, 982, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clm_channels", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 982, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.clm_channels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_34clm_channels(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_34clm_channels(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_channels", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_35clm_channels, 0, __pyx_n_s_clm_channels, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_40); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clm_channels, __pyx_t_37) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clm_channels, 982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 982, __pyx_L1_error)
 0983: def clm_channels(x):
 0984:     pass
 0985: 
+0986: @clm_channels.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_37_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_37_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_37_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_37_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 986, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 986, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyString_Type), 0, "x", 1))) __PYX_ERR(0, 987, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_36_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_36_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_register); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 986, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_37_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_41); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_37) < 0) __PYX_ERR(0, 986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 986, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 986, __pyx_L1_error)
 0987: def _(x: str):  #assume it is a file
+0988:     return csndlib.mus_sound_chans(x)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_x); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(mus_sound_chans(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 0989: 
+0990: @clm_channels.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_39_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_39_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_39_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_39_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 990, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 990, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 990, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "x", 0))) __PYX_ERR(0, 991, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_38_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_38_(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_register); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_39_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_40); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_37) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 990, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 990, __pyx_L1_error)
 0991: def _(x: mus_any):  #assume it is a gen
+0992:     return x.mus_channels
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_mus_channels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0993: 
+0994: @clm_channels.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_41_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_41_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_41_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_41_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 994, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 994, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyList_Type), 0, "x", 1))) __PYX_ERR(0, 995, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_40_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_40_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_register); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_n_s_list) < 0) __PYX_ERR(0, 994, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_41_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_41); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_37) < 0) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 994, __pyx_L1_error)
 0995: def _(x: list):
+0996:     return len(x)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_x); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 996, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 0997: 
+0998: @clm_channels.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_43_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_43_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_43_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_43_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 998, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 998, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 998, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 0, "x", 0))) __PYX_ERR(0, 999, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_42_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_42_(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_register); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_np_ndarray) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_43_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_40); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_37) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 998, __pyx_L1_error)
 0999: def _(x: np.ndarray):
+1000:     if x.ndim == 1:
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 1);
  if (__pyx_t_2) {
/* … */
  }
+1001:         return 1
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_1);
    __pyx_r = __pyx_int_1;
    goto __pyx_L0;
+1002:     elif x.ndim == 2:
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 2);
  if (likely(__pyx_t_2)) {
/* … */
  }
+1003:         return np.shape(x)[0]
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
 1004:     else:
+1005:         raise RuntimeError(f'ndarray must have 1 or 2 dimensions not {x.ndim}. ')
  /*else*/ {
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    __pyx_t_6 += 40;
    __Pyx_GIVEREF(__pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1005, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_t_1, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__13);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__13);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__13);
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1005, __pyx_L1_error)
  }
 1006: 
 1007: # --------------- clm_srate ---------------- #
+1008: @singledispatch
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_45clm_srate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_45clm_srate = {"clm_srate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_45clm_srate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_45clm_srate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_srate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clm_srate") < 0)) __PYX_ERR(0, 1008, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clm_srate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1008, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.clm_srate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_44clm_srate(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_44clm_srate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_srate", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_45clm_srate, 0, __pyx_n_s_clm_srate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_40); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clm_srate, __pyx_t_41) < 0) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clm_srate, 1008, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 1008, __pyx_L1_error)
 1009: def clm_srate(x):
 1010:     pass
 1011: 
+1012: @clm_srate.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_47_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_47_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_47_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_47_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1012, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1012, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1012, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyString_Type), 0, "x", 1))) __PYX_ERR(0, 1013, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_46_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_46_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_clm_srate); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_47_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_37); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 1012, __pyx_L1_error)
 1013: def _(x: str): #file
+1014:     return csndlib.mus_sound_srate(x)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_x); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(mus_sound_srate(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 1015: 
 1016: # --------------- clm_framples ---------------- #
+1017: @singledispatch
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_49clm_framples(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_49clm_framples = {"clm_framples", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_49clm_framples, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_49clm_framples(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_framples (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clm_framples") < 0)) __PYX_ERR(0, 1017, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clm_framples", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1017, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.clm_framples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_48clm_framples(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_48clm_framples(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_framples", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_49clm_framples, 0, __pyx_n_s_clm_framples, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_37); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clm_framples, __pyx_t_40) < 0) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clm_framples, 1017, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 1017, __pyx_L1_error)
 1018: def clm_framples(x):
 1019:     pass
 1020: 
+1021: @clm_framples.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_51_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_51_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_51_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_51_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1021, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1021, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyString_Type), 0, "x", 1))) __PYX_ERR(0, 1022, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_50_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_50_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_clm_framples); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_register); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_51_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_41); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_40) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 1021, __pyx_L1_error)
 1022: def _(x: str):# assume file
+1023:     return csndlib.mus_sound_framples(x)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_x); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1023, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(mus_sound_framples(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 1024: 
+1025: @clm_framples.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_53_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_53_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_53_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_53_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1025, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1025, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "x", 0))) __PYX_ERR(0, 1026, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_52_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_52_(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_clm_framples); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_register); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1025, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_53_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_37); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_40) < 0) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 1025, __pyx_L1_error)
 1026: def _(x: mus_any):# 
+1027:     return x.mus_length
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_mus_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1028: 
+1029: @clm_framples.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_55_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_55_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_55_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_55_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1029, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1029, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyList_Type), 0, "x", 1))) __PYX_ERR(0, 1030, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_54_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_54_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_clm_framples); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_register); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_n_s_list) < 0) __PYX_ERR(0, 1029, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_55_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_41); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_40) < 0) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1029, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 1029, __pyx_L1_error)
 1030: def _(x: list):
+1031:     return len(x[0])
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1032: 
+1033: @clm_framples.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_57_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_57_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_57_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_57_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1033, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1033, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1033, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 0, "x", 0))) __PYX_ERR(0, 1034, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_56_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_56_(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_clm_framples); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_register); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_kp_s_np_ndarray) < 0) __PYX_ERR(0, 1033, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_57_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_37); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_40) < 0) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1033, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 1033, __pyx_L1_error)
 1034: def _(x: np.ndarray):
+1035:     if x.ndim == 1:
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 1);
  if (__pyx_t_2) {
/* … */
  }
+1036:         return np.shape(x)[0]
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
+1037:     elif x.ndim == 2:
  __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 2);
  if (likely(__pyx_t_2)) {
/* … */
  }
+1038:         return np.shape(x)[1]
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_x)};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
 1039:     else:
+1040:         raise RuntimeError(f'ndarray must have 1 or 2 dimensions not {x.ndim}. ')
  /*else*/ {
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    __pyx_t_6 += 40;
    __Pyx_GIVEREF(__pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_ndarray_must_have_1_or_2_dimensi);
    __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1040, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_t_1, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__13);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__13);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__13);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1040, __pyx_L1_error)
  }
 1041: 
 1042: # --------------- clm random ---------------- # 
+1043: @singledispatch
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_59_random(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_59_random = {"_random", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_59_random, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_59_random(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_random (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_random") < 0)) __PYX_ERR(0, 1043, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_random", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1043, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._random", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_58_random(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_58_random(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_random", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_59_random, 0, __pyx_n_s_random_2, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_37); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random_2, __pyx_t_41) < 0) __PYX_ERR(0, 1043, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_random_2, 1043, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 1043, __pyx_L1_error)
 1044: def _random(x):
 1045:     pass
 1046: 
+1047: @_random.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_61_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_61_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_61_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_61_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1047, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1048, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1047, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_60_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_60_(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_random_2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_n_s_float) < 0) __PYX_ERR(0, 1047, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_61_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_40); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1047, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 1047, __pyx_L1_error)
 1048: def _(x: float):
+1049:     return random.random()
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[1] = {__pyx_t_2, };
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1050: 
+1051: @_random.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_63_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_63_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_63_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_63_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1051, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1051, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyInt_Type), 0, "x", 1))) __PYX_ERR(0, 1052, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_62_(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_62_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_random_2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_register); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1051, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_63_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyObject_CallOneArg(__pyx_t_40, __pyx_t_37); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_41) < 0) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1051, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 1051, __pyx_L1_error)
 1052: def _(x: int):
+1053:     return random.randrange(x)
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_randrange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_x};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1054: 
+1055: @singledispatch
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_65_random2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_65_random2 = {"_random2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_65_random2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_65_random2(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  CYTHON_UNUSED PyObject *__pyx_v_y = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_random2 (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_random2", 1, 2, 2, 1); __PYX_ERR(0, 1055, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_random2") < 0)) __PYX_ERR(0, 1055, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_random2", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1055, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._random2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_64_random2(__pyx_self, __pyx_v_x, __pyx_v_y);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_64_random2(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_random2", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_singledispatch); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
/* … */
  __pyx_tuple__164 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_65_random2, 0, __pyx_n_s_random2, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_37); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random2, __pyx_t_40) < 0) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_random2, 1055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 1055, __pyx_L1_error)
 1056: def _random2(x, y):
 1057:     pass
 1058: 
+1059: @_random2.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_67_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_67_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_67_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_67_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  double __pyx_v_y;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_", 1, 2, 2, 1); __PYX_ERR(0, 1059, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L3_error)
    __pyx_v_y = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1059, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_66_(__pyx_self, __pyx_v_x, __pyx_v_y);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_66_(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_random2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_register); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_n_s_float) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_y, __pyx_n_s_float) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_67_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_37, __pyx_t_41); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_40) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1059, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 1059, __pyx_L1_error)
 1060: def _(x:float , y: float):
+1061:     return random.uniform(x,y)
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uniform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1062: 
+1063: @_random2.register
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_69_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_69_ = {"_", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_69_, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_69_(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1063, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1063, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_", 1, 2, 2, 1); __PYX_ERR(0, 1063, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_") < 0)) __PYX_ERR(0, 1063, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = ((PyObject*)values[0]);
    __pyx_v_y = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1063, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), (&PyInt_Type), 0, "x", 1))) __PYX_ERR(0, 1064, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), (&PyInt_Type), 0, "y", 1))) __PYX_ERR(0, 1064, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_68_(__pyx_self, __pyx_v_x, __pyx_v_y);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_68_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm._", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_random2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_register); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_y, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_69_, 0, __pyx_n_s__131, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_41, __pyx_t_37); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__131, __pyx_t_40) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s__131, 1063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 1063, __pyx_L1_error)
 1064: def _(x:int , y: int):
+1065:     return random.randrange(x, y)
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_randrange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_x, __pyx_v_y};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1066: 
+1067: def clm_random(*args):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_71clm_random(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_71clm_random = {"clm_random", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8pysndlib_3clm_71clm_random, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_71clm_random(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_random (wrapper)", 0);
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clm_random", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8pysndlib_3clm_70clm_random(__pyx_self, __pyx_v_args);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_70clm_random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clm_random", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.clm_random", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_71clm_random, 0, __pyx_n_s_clm_random, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clm_random, __pyx_t_40) < 0) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clm_random, 1067, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 1067, __pyx_L1_error)
+1068:     if len(args) == 0:
  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1068, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 0);
  if (__pyx_t_2) {
/* … */
  }
+1069:         return random.random()
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[1] = {__pyx_t_4, };
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
+1070:     elif len(args) == 1:
  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 == 1);
  if (__pyx_t_2) {
/* … */
  }
+1071:         return _random(args[0])
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_random_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
 1072:     else:
+1073:         return _random2(args[0], args[1])
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_random2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
 1074: 
 1075: 
 1076: # --------------- just some extra utils ---------------- #    
 1077: 
+1078: def validate_envelope(e):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_73validate_envelope(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_73validate_envelope = {"validate_envelope", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_73validate_envelope, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_73validate_envelope(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_e = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate_envelope (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1078, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "validate_envelope") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_e = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("validate_envelope", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1078, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.validate_envelope", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_72validate_envelope(__pyx_self, __pyx_v_e);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8pysndlib_3clm_17validate_envelope_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_72validate_envelope(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) {
  PyObject *__pyx_7genexpr__pyx_v_i = NULL;
  PyObject *__pyx_gb_8pysndlib_3clm_17validate_envelope_2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate_envelope", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.validate_envelope", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
  __Pyx_XDECREF(__pyx_gb_8pysndlib_3clm_17validate_envelope_2generator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__170 = PyTuple_Pack(4, __pyx_n_s_e, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_73validate_envelope, 0, __pyx_n_s_validate_envelope, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_validate_envelope, __pyx_t_40) < 0) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_validate_envelope, 1078, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 1078, __pyx_L1_error)
 1079:     # is env even number length
+1080:     if len(e) < 2:
  __pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 < 2);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+1081:         raise RuntimeError("a valid envelope needs at least 2 elements")
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1081, __pyx_L1_error)
/* … */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_a_valid_envelope_needs_at_least); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);
+1082:     if len(e) % 2 != 0:
  __pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1082, __pyx_L1_error)
  __pyx_t_2 = (__Pyx_mod_Py_ssize_t(__pyx_t_1, 2) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+1083:         raise RuntimeError("a valid envelope needs even number of elements. This has {len(e)}")
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1083, __pyx_L1_error)
/* … */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_a_valid_envelope_needs_even_numb); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
+1084:     if isinstance(e, list):
  __pyx_t_2 = PyList_Check(__pyx_v_e); 
  if (__pyx_t_2) {
/* … */
  }
+1085:         if all([isinstance(i, int | float) for i in e]):
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1085, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_v_e)) || PyTuple_CheckExact(__pyx_v_e)) {
        __pyx_t_4 = __pyx_v_e; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0;
        __pyx_t_5 = NULL;
      } else {
        __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1085, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1085, __pyx_L9_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1085, __pyx_L9_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1085, __pyx_L9_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_5(__pyx_t_4);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1085, __pyx_L9_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Or(((PyObject *)(&PyInt_Type)), ((PyObject *)(&PyFloat_Type))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L9_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_6);
        __pyx_t_2 = __Pyx_TypeCheck(__pyx_7genexpr__pyx_v_i, __pyx_t_6); 
        __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1085, __pyx_L9_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
      goto __pyx_L13_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1085, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_2)) {
/* … */
    }
+1086:             raise RuntimeError("a valid envelope can only contain numbers.")
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1086, __pyx_L1_error)
/* … */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_a_valid_envelope_can_only_contai); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);
+1087:     if not all(i < j for i, j in zip(e[: : 2], e[2: : 2])):
static PyObject *__pyx_pf_8pysndlib_3clm_17validate_envelope_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct__genexpr *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct__genexpr(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1087, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8pysndlib_3clm_17validate_envelope_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_validate_envelope_locals_genexpr, __pyx_n_s_pysndlib_clm); if (unlikely(!gen)) __PYX_ERR(0, 1087, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.validate_envelope.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8pysndlib_3clm_17validate_envelope_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1087, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1087, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1087, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1087, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1087, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1087, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1087, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1087, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_j);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_j, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_i, __pyx_cur_scope->__pyx_v_j, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = (!__pyx_t_9);
    if (__pyx_t_10) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_e, __pyx_slice__20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_e, __pyx_slice__24); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_8pysndlib_3clm_17validate_envelope_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (!__pyx_t_2);
  if (unlikely(__pyx_t_7)) {
/* … */
  __pyx_slice__24 = PySlice_New(__pyx_int_2, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__24);
  __Pyx_GIVEREF(__pyx_slice__24);
/* … */
  }
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_j;
};

+1088:         raise RuntimeError("x values of envelope must be increasing")
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1088, __pyx_L1_error)
/* … */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_x_values_of_envelope_must_be_inc); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
 1089: 
+1090: def is_zero(x):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_75is_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_75is_zero = {"is_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_75is_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_75is_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_zero (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_zero") < 0)) __PYX_ERR(0, 1090, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_zero", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1090, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_74is_zero(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_74is_zero(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_zero", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_75is_zero, 0, __pyx_n_s_is_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_zero, __pyx_t_40) < 0) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_zero, 1090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 1090, __pyx_L1_error)
+1091:     return x == 0
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_x, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1092: 
+1093: def is_number(n):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_77is_number(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_77is_number = {"is_number", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_77is_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_77is_number(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_n = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_number (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1093, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_number") < 0)) __PYX_ERR(0, 1093, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1093, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_number", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_76is_number(__pyx_self, __pyx_v_n);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_76is_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_number", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_number", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_s_n); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_77is_number, 0, __pyx_n_s_is_number, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_number, __pyx_t_40) < 0) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_number, 1093, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 1093, __pyx_L1_error)
+1094:     return type(n) == int or type(n) == float
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_n)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1094, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_n)), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1095: 
 1096: # # --------------- clm utility functions ---------------- #
 1097: # 
+1098: cpdef cython.double radians2hz(radians: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_79radians2hz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_radians2hz(double __pyx_v_radians, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("radians2hz", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_79radians2hz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_78radians2hz, "\n    convert radians per sample to frequency:  `hz = rads * srate / (2 * pi)`.\n    \n    :param radians: frequency \\in radians\n    :return: frequency \\in hertz\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_79radians2hz = {"radians2hz", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_79radians2hz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_78radians2hz};
static PyObject *__pyx_pw_8pysndlib_3clm_79radians2hz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_radians;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("radians2hz (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radians,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radians)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1098, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "radians2hz") < 0)) __PYX_ERR(0, 1098, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_radians = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_radians == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1098, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("radians2hz", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1098, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.radians2hz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_78radians2hz(__pyx_self, __pyx_v_radians);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_78radians2hz(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_radians) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("radians2hz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_radians2hz(__pyx_v_radians, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1098, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.radians2hz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__175 = PyTuple_Pack(1, __pyx_n_s_radians); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_radians, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1098, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_79radians2hz, 0, __pyx_n_s_radians2hz, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_radians2hz, __pyx_t_37) < 0) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_radians2hz, 1098, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1098, __pyx_L1_error)
 1099:     """
 1100:     convert radians per sample to frequency:  `hz = rads * srate / (2 * pi)`.
 1101:     
 1102:     :param radians: frequency \in radians
 1103:     :return: frequency \in hertz
 1104:     :rtype: float
 1105:     """
 1106: 
+1107:     return cclm.mus_radians_to_hz(radians)
  __pyx_r = mus_radians_to_hz(__pyx_v_radians);
  goto __pyx_L0;
 1108: 
+1109: cpdef cython.double hz2radians(hz: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_81hz2radians(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_hz2radians(double __pyx_v_hz, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hz2radians", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_81hz2radians(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_80hz2radians, "\n    convert frequency in hz to radians per sample:  `hz * 2 * pi / srate`.\n    \n    :param hz: frequency \\in hertz\n    :return: frequency \\in radians\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_81hz2radians = {"hz2radians", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_81hz2radians, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_80hz2radians};
static PyObject *__pyx_pw_8pysndlib_3clm_81hz2radians(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_hz;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hz2radians (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hz,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hz)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hz2radians") < 0)) __PYX_ERR(0, 1109, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_hz = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_hz == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hz2radians", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1109, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.hz2radians", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_80hz2radians(__pyx_self, __pyx_v_hz);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_80hz2radians(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_hz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hz2radians", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_hz2radians(__pyx_v_hz, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.hz2radians", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_s_hz); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_hz, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1109, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_81hz2radians, 0, __pyx_n_s_hz2radians, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hz2radians, __pyx_t_40) < 0) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_hz2radians, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1109, __pyx_L1_error)
 1110:     """
 1111:     convert frequency in hz to radians per sample:  `hz * 2 * pi / srate`.
 1112:     
 1113:     :param hz: frequency \in hertz
 1114:     :return: frequency \in radians
 1115:     :rtype: float
 1116:     """
+1117:     return cclm.mus_hz_to_radians(hz)
  __pyx_r = mus_hz_to_radians(__pyx_v_hz);
  goto __pyx_L0;
 1118: 
+1119: cpdef cython.double degrees2radians(degrees: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_83degrees2radians(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_degrees2radians(double __pyx_v_degrees, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("degrees2radians", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_83degrees2radians(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_82degrees2radians, "\n    convert degrees to radians:  `degrees * 2 * pi / 360`.\n    \n    :param degrees: angle in degrees\n    :return: angle in radians\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_83degrees2radians = {"degrees2radians", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_83degrees2radians, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_82degrees2radians};
static PyObject *__pyx_pw_8pysndlib_3clm_83degrees2radians(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_degrees;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("degrees2radians (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_degrees,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_degrees)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "degrees2radians") < 0)) __PYX_ERR(0, 1119, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_degrees = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_degrees == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("degrees2radians", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1119, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.degrees2radians", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_82degrees2radians(__pyx_self, __pyx_v_degrees);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_82degrees2radians(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_degrees) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("degrees2radians", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_degrees2radians(__pyx_v_degrees, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.degrees2radians", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_degrees); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_degrees, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_83degrees2radians, 0, __pyx_n_s_degrees2radians, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_degrees2radians, __pyx_t_37) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_degrees2radians, 1119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1119, __pyx_L1_error)
 1120:     """
 1121:     convert degrees to radians:  `degrees * 2 * pi / 360`.
 1122:     
 1123:     :param degrees: angle in degrees
 1124:     :return: angle in radians
 1125:     :rtype: float
 1126:     
 1127:     """
+1128:     return cclm.mus_degrees_to_radians(degrees)
  __pyx_r = mus_degrees_to_radians(__pyx_v_degrees);
  goto __pyx_L0;
 1129: 
+1130: cpdef cython.double radians2degrees(radians: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_85radians2degrees(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_radians2degrees(double __pyx_v_radians, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("radians2degrees", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_85radians2degrees(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_84radians2degrees, "\n    convert radians to degrees: `rads * 360 / (2 * pi)`.\n    \n    :param radians: angle in radians\n    :return: degree\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_85radians2degrees = {"radians2degrees", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_85radians2degrees, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_84radians2degrees};
static PyObject *__pyx_pw_8pysndlib_3clm_85radians2degrees(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_radians;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("radians2degrees (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radians,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radians)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "radians2degrees") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_radians = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_radians == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("radians2degrees", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1130, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.radians2degrees", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_84radians2degrees(__pyx_self, __pyx_v_radians);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_84radians2degrees(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_radians) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("radians2degrees", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_radians2degrees(__pyx_v_radians, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.radians2degrees", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_radians, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1130, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_85radians2degrees, 0, __pyx_n_s_radians2degrees, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_radians2degrees, __pyx_t_40) < 0) __PYX_ERR(0, 1130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_radians2degrees, 1130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 1130, __pyx_L1_error)
 1131:     """
 1132:     convert radians to degrees: `rads * 360 / (2 * pi)`.
 1133:     
 1134:     :param radians: angle in radians
 1135:     :return: degree
 1136:     :rtype: float
 1137:     
 1138:     """
 1139: 
+1140:     return cclm.mus_radians_to_degrees(radians)
  __pyx_r = mus_radians_to_degrees(__pyx_v_radians);
  goto __pyx_L0;
 1141: 
+1142: cpdef cython.double db2linear(x: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_87db2linear(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_db2linear(double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("db2linear", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_87db2linear(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_86db2linear, "\n    convert decibel value db to linear value: `pow(10, db / 20)`.\n\n    :param x: decibel\n    :return: linear amplitude\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_87db2linear = {"db2linear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_87db2linear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_86db2linear};
static PyObject *__pyx_pw_8pysndlib_3clm_87db2linear(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("db2linear (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "db2linear") < 0)) __PYX_ERR(0, 1142, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("db2linear", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1142, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.db2linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_86db2linear(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_86db2linear(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("db2linear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_db2linear(__pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.db2linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_87db2linear, 0, __pyx_n_s_db2linear, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_db2linear, __pyx_t_37) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_db2linear, 1142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 1142, __pyx_L1_error)
 1143:     """
 1144:     convert decibel value db to linear value: `pow(10, db / 20)`.
 1145: 
 1146:     :param x: decibel
 1147:     :return: linear amplitude
 1148:     :rtype: float
 1149:     
 1150:     """
 1151: 
+1152:     return cclm.mus_db_to_linear(x)
  __pyx_r = mus_db_to_linear(__pyx_v_x);
  goto __pyx_L0;
 1153: 
+1154: cpdef cython.double linear2db(x: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_89linear2db(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_linear2db(double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear2db", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_89linear2db(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_88linear2db, "\n    convert linear value to decibels 20 * log10(lin).\n\n    :param x: linear amplitude\n    :return: decibel\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_89linear2db = {"linear2db", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_89linear2db, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_88linear2db};
static PyObject *__pyx_pw_8pysndlib_3clm_89linear2db(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear2db (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "linear2db") < 0)) __PYX_ERR(0, 1154, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("linear2db", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1154, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.linear2db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_88linear2db(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_88linear2db(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear2db", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_linear2db(__pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1154, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.linear2db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1154, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_89linear2db, 0, __pyx_n_s_linear2db, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_linear2db, __pyx_t_40) < 0) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_linear2db, 1154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 1154, __pyx_L1_error)
 1155:     """
 1156:     convert linear value to decibels 20 * log10(lin).
 1157: 
 1158:     :param x: linear amplitude
 1159:     :return: decibel
 1160:     :rtype: float
 1161:     
 1162:     """
 1163: 
+1164:     return cclm.mus_linear_to_db(x)
  __pyx_r = mus_linear_to_db(__pyx_v_x);
  goto __pyx_L0;
 1165: 
+1166: cpdef cython.double odd_multiple(x: cython.double , y: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_91odd_multiple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_odd_multiple(double __pyx_v_x, double __pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("odd_multiple", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_91odd_multiple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_90odd_multiple, "\n    return y times the nearest odd integer to x.\n    \n    :param x:\n    :param y:\n    :return: nearest odd integer as a float\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_91odd_multiple = {"odd_multiple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_91odd_multiple, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_90odd_multiple};
static PyObject *__pyx_pw_8pysndlib_3clm_91odd_multiple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  double __pyx_v_y;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("odd_multiple (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("odd_multiple", 1, 2, 2, 1); __PYX_ERR(0, 1166, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "odd_multiple") < 0)) __PYX_ERR(0, 1166, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L3_error)
    __pyx_v_y = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("odd_multiple", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1166, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.odd_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_90odd_multiple(__pyx_self, __pyx_v_x, __pyx_v_y);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_90odd_multiple(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("odd_multiple", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_odd_multiple(__pyx_v_x, __pyx_v_y, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.odd_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_y, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_91odd_multiple, 0, __pyx_n_s_odd_multiple, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_odd_multiple, __pyx_t_37) < 0) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_odd_multiple, 1166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1166, __pyx_L1_error)
 1167:     """
 1168:     return y times the nearest odd integer to x.
 1169:     
 1170:     :param x:
 1171:     :param y:
 1172:     :return: nearest odd integer as a float
 1173:     :rtype: float
 1174:     
 1175:     """
 1176: 
+1177:     return cclm.mus_odd_multiple(x,y)
  __pyx_r = mus_odd_multiple(__pyx_v_x, __pyx_v_y);
  goto __pyx_L0;
 1178: 
+1179: cpdef cython.double even_multiple(x: cython.double , y: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_93even_multiple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_even_multiple(double __pyx_v_x, double __pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("even_multiple", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_93even_multiple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_92even_multiple, "\n    return y times the nearest even integer to x.\n    \n    :param x:\n    :param y:\n    :return: nearest even integer as a float\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_93even_multiple = {"even_multiple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_93even_multiple, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_92even_multiple};
static PyObject *__pyx_pw_8pysndlib_3clm_93even_multiple(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  double __pyx_v_y;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("even_multiple (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("even_multiple", 1, 2, 2, 1); __PYX_ERR(0, 1179, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "even_multiple") < 0)) __PYX_ERR(0, 1179, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L3_error)
    __pyx_v_y = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("even_multiple", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1179, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.even_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_92even_multiple(__pyx_self, __pyx_v_x, __pyx_v_y);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_92even_multiple(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("even_multiple", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_even_multiple(__pyx_v_x, __pyx_v_y, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.even_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_y, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_93even_multiple, 0, __pyx_n_s_even_multiple, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_even_multiple, __pyx_t_40) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_even_multiple, 1179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 1179, __pyx_L1_error)
 1180:     """
 1181:     return y times the nearest even integer to x.
 1182:     
 1183:     :param x:
 1184:     :param y:
 1185:     :return: nearest even integer as a float
 1186:     :rtype: float
 1187:     """
 1188: 
+1189:     return cclm.mus_even_multiple(x,y)
  __pyx_r = mus_even_multiple(__pyx_v_x, __pyx_v_y);
  goto __pyx_L0;
 1190: 
+1191: cpdef cython.double odd_weight(x: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_95odd_weight(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_odd_weight(double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("odd_weight", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_95odd_weight(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_94odd_weight, "\n    return a number between 0.0 (x is even) and 1.0 (x is odd).\n    \n    :param x:\n    :return weight:\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_95odd_weight = {"odd_weight", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_95odd_weight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_94odd_weight};
static PyObject *__pyx_pw_8pysndlib_3clm_95odd_weight(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("odd_weight (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "odd_weight") < 0)) __PYX_ERR(0, 1191, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("odd_weight", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1191, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.odd_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_94odd_weight(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_94odd_weight(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("odd_weight", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_odd_weight(__pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.odd_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_95odd_weight, 0, __pyx_n_s_odd_weight, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_odd_weight, __pyx_t_37) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_odd_weight, 1191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 1191, __pyx_L1_error)
 1192:     """
 1193:     return a number between 0.0 (x is even) and 1.0 (x is odd).
 1194:     
 1195:     :param x:
 1196:     :return weight:
 1197:     :rtype: float
 1198:     
 1199:     """
 1200: 
+1201:     return cclm.mus_odd_weight(x)
  __pyx_r = mus_odd_weight(__pyx_v_x);
  goto __pyx_L0;
 1202: 
+1203: cpdef cython.double even_weight(x: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_97even_weight(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_even_weight(double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("even_weight", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_97even_weight(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_96even_weight, "\n    return a number between 0.0 (x is odd) and 1.0 (x is even).\n    \n    :param x:\n    :return weight:\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_97even_weight = {"even_weight", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_97even_weight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_96even_weight};
static PyObject *__pyx_pw_8pysndlib_3clm_97even_weight(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("even_weight (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "even_weight") < 0)) __PYX_ERR(0, 1203, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("even_weight", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1203, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.even_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_96even_weight(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_96even_weight(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("even_weight", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_even_weight(__pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.even_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1203, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_97even_weight, 0, __pyx_n_s_even_weight, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_even_weight, __pyx_t_40) < 0) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_even_weight, 1203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 1203, __pyx_L1_error)
 1204:     """
 1205:     return a number between 0.0 (x is odd) and 1.0 (x is even).
 1206:     
 1207:     :param x:
 1208:     :return weight:
 1209:     :rtype: float
 1210:     """
 1211: 
+1212:     return cclm.mus_even_weight(x)
  __pyx_r = mus_even_weight(__pyx_v_x);
  goto __pyx_L0;
 1213: 
+1214: cpdef cython.double get_srate():
static PyObject *__pyx_pw_8pysndlib_3clm_99get_srate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static double __pyx_f_8pysndlib_3clm_get_srate(CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_srate", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_99get_srate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_98get_srate, "\n    return current sample rate.\n    \n    :return samplerate:\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_99get_srate = {"get_srate", (PyCFunction)__pyx_pw_8pysndlib_3clm_99get_srate, METH_NOARGS, __pyx_doc_8pysndlib_3clm_98get_srate};
static PyObject *__pyx_pw_8pysndlib_3clm_99get_srate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_srate (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_98get_srate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_98get_srate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_srate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.get_srate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_99get_srate, 0, __pyx_n_s_get_srate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_srate, __pyx_t_40) < 0) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_get_srate, 1214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 1214, __pyx_L1_error)
 1215:     """
 1216:     return current sample rate.
 1217:     
 1218:     :return samplerate:
 1219:     :rtype: float
 1220:     
 1221:     """
+1222:     return cclm.mus_srate()
  __pyx_r = mus_srate();
  goto __pyx_L0;
 1223: 
+1224: cpdef cython.double set_srate(r: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_101set_srate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_set_srate(double __pyx_v_r, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_srate", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_101set_srate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_100set_srate, "\n    set current sample rate.\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_101set_srate = {"set_srate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_101set_srate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_100set_srate};
static PyObject *__pyx_pw_8pysndlib_3clm_101set_srate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_r;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_srate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1224, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_srate") < 0)) __PYX_ERR(0, 1224, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_r = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_r == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1224, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_srate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1224, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.set_srate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_100set_srate(__pyx_self, __pyx_v_r);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_100set_srate(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_srate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_set_srate(__pyx_v_r, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1224, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.set_srate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__189 = PyTuple_Pack(1, __pyx_n_s_r); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_r, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_101set_srate, 0, __pyx_n_s_set_srate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_srate, __pyx_t_37) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_set_srate, 1224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 1224, __pyx_L1_error)
 1225:     """
 1226:     set current sample rate.
 1227:     """
+1228:     return cclm.mus_set_srate(r)
  __pyx_r = mus_set_srate(__pyx_v_r);
  goto __pyx_L0;
 1229: 
+1230: cpdef cclm.mus_long_t seconds2samples(secs: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_103seconds2samples(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static mus_long_t __pyx_f_8pysndlib_3clm_seconds2samples(double __pyx_v_secs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  mus_long_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seconds2samples", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_103seconds2samples(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_102seconds2samples, "\n    use mus_srate to convert seconds to samples.\n    \n    :param secs: time in seconds\n    :return: time in samples\n    :rtype: int\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_103seconds2samples = {"seconds2samples", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_103seconds2samples, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_102seconds2samples};
static PyObject *__pyx_pw_8pysndlib_3clm_103seconds2samples(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_secs;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seconds2samples (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_secs,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_secs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seconds2samples") < 0)) __PYX_ERR(0, 1230, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_secs = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_secs == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seconds2samples", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1230, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.seconds2samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_102seconds2samples(__pyx_self, __pyx_v_secs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_102seconds2samples(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_secs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seconds2samples", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_seconds2samples(__pyx_v_secs, 0); if (unlikely(__pyx_t_1 == ((mus_long_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.seconds2samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__191 = PyTuple_Pack(1, __pyx_n_s_secs); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_secs, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1230, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_103seconds2samples, 0, __pyx_n_s_seconds2samples, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_seconds2samples, __pyx_t_40) < 0) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_seconds2samples, 1230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 1230, __pyx_L1_error)
 1231:     """
 1232:     use mus_srate to convert seconds to samples.
 1233:     
 1234:     :param secs: time in seconds
 1235:     :return: time in samples
 1236:     :rtype: int
 1237:     """
+1238:     return cclm.mus_seconds_to_samples(secs)
  __pyx_r = mus_seconds_to_samples(__pyx_v_secs);
  goto __pyx_L0;
 1239: 
+1240: cpdef cython.double samples2seconds(samples: mus_long_t):
static PyObject *__pyx_pw_8pysndlib_3clm_105samples2seconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_samples2seconds(PyObject *__pyx_v_samples, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("samples2seconds", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.samples2seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_105samples2seconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_104samples2seconds, "\n    use mus_srate to convert samples to seconds.\n    \n    :param samples: number of samples\n    :return: time in seconds\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_105samples2seconds = {"samples2seconds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_105samples2seconds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_104samples2seconds};
static PyObject *__pyx_pw_8pysndlib_3clm_105samples2seconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_samples = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("samples2seconds (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_samples)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1240, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "samples2seconds") < 0)) __PYX_ERR(0, 1240, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_samples = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("samples2seconds", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1240, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.samples2seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_104samples2seconds(__pyx_self, __pyx_v_samples);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_104samples2seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_samples) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("samples2seconds", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_samples2seconds(__pyx_v_samples, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1240, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.samples2seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_n_s_samples); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_samples, __pyx_n_s_mus_long_t) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_105samples2seconds, 0, __pyx_n_s_samples2seconds, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_samples2seconds, __pyx_t_37) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_samples2seconds, 1240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1240, __pyx_L1_error)
 1241:     """
 1242:     use mus_srate to convert samples to seconds.
 1243:     
 1244:     :param samples: number of samples
 1245:     :return: time in seconds
 1246:     :rtype: float
 1247:     
 1248:     """
+1249:     return cclm.mus_samples_to_seconds(samples)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_samples); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1249, __pyx_L1_error)
  __pyx_r = mus_samples_to_seconds(__pyx_t_1);
  goto __pyx_L0;
 1250: 
+1251: cpdef cython.double ring_modulate(s1: cython.double, s2: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_107ring_modulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_ring_modulate(double __pyx_v_s1, double __pyx_v_s2, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ring_modulate", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_107ring_modulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_106ring_modulate, "\n    return s1 * s2 (sample by sample multiply).\n    \n    :param s1: input 1\n    :param s2: input 2\n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_107ring_modulate = {"ring_modulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_107ring_modulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_106ring_modulate};
static PyObject *__pyx_pw_8pysndlib_3clm_107ring_modulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_s1;
  double __pyx_v_s2;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ring_modulate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s1,&__pyx_n_s_s2,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("ring_modulate", 1, 2, 2, 1); __PYX_ERR(0, 1251, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ring_modulate") < 0)) __PYX_ERR(0, 1251, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_s1 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_s1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L3_error)
    __pyx_v_s2 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_s2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ring_modulate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1251, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.ring_modulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_106ring_modulate(__pyx_self, __pyx_v_s1, __pyx_v_s2);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_106ring_modulate(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_s1, double __pyx_v_s2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ring_modulate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_ring_modulate(__pyx_v_s1, __pyx_v_s2, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.ring_modulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__195 = PyTuple_Pack(2, __pyx_n_s_s1, __pyx_n_s_s2); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_s1, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1251, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_s2, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1251, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_107ring_modulate, 0, __pyx_n_s_ring_modulate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ring_modulate, __pyx_t_40) < 0) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_ring_modulate, 1251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 1251, __pyx_L1_error)
 1252:     """
 1253:     return s1 * s2 (sample by sample multiply).
 1254:     
 1255:     :param s1: input 1
 1256:     :param s2: input 2
 1257:     :return: result
 1258:     :rtype: float
 1259:     
 1260:     """
 1261: 
+1262:     return cclm.mus_ring_modulate(s1, s2)
  __pyx_r = mus_ring_modulate(__pyx_v_s1, __pyx_v_s2);
  goto __pyx_L0;
 1263: 
+1264: cpdef cython.double amplitude_modulate(s1: cython.double, s2: cython.double , s3: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_109amplitude_modulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_amplitude_modulate(double __pyx_v_s1, double __pyx_v_s2, double __pyx_v_s3, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("amplitude_modulate", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_109amplitude_modulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_108amplitude_modulate, "\n    carrier in1 in2): in1 * (carrier + in2).\n        \n    :param s1: input 1\n    :param s2: input 2\n    :param s3: input 3\n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_109amplitude_modulate = {"amplitude_modulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_109amplitude_modulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_108amplitude_modulate};
static PyObject *__pyx_pw_8pysndlib_3clm_109amplitude_modulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_s1;
  double __pyx_v_s2;
  double __pyx_v_s3;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("amplitude_modulate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s1,&__pyx_n_s_s2,&__pyx_n_s_s3,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("amplitude_modulate", 1, 3, 3, 1); __PYX_ERR(0, 1264, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s3)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("amplitude_modulate", 1, 3, 3, 2); __PYX_ERR(0, 1264, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "amplitude_modulate") < 0)) __PYX_ERR(0, 1264, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_s1 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_s1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
    __pyx_v_s2 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_s2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
    __pyx_v_s3 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_s3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("amplitude_modulate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1264, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.amplitude_modulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_108amplitude_modulate(__pyx_self, __pyx_v_s1, __pyx_v_s2, __pyx_v_s3);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_108amplitude_modulate(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_s1, double __pyx_v_s2, double __pyx_v_s3) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("amplitude_modulate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_amplitude_modulate(__pyx_v_s1, __pyx_v_s2, __pyx_v_s3, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.amplitude_modulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__197 = PyTuple_Pack(3, __pyx_n_s_s1, __pyx_n_s_s2, __pyx_n_s_s3); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_s1, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_s2, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_s3, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_109amplitude_modulate, 0, __pyx_n_s_amplitude_modulate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_amplitude_modulate, __pyx_t_37) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_amplitude_modulate, 1264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 1264, __pyx_L1_error)
 1265:     """
 1266:     carrier in1 in2): in1 * (carrier + in2).
 1267:         
 1268:     :param s1: input 1
 1269:     :param s2: input 2
 1270:     :param s3: input 3
 1271:     :return: result
 1272:     :rtype: float
 1273:     
 1274:     """
+1275:     return cclm.mus_amplitude_modulate(s1, s2, s3)
  __pyx_r = mus_amplitude_modulate(__pyx_v_s1, __pyx_v_s2, __pyx_v_s3);
  goto __pyx_L0;
 1276: 
+1277: cpdef cython.double contrast_enhancement(insig: cython.double, fm_index: cython.double =1.0 ):
static PyObject *__pyx_pw_8pysndlib_3clm_111contrast_enhancement(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_contrast_enhancement(double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_contrast_enhancement *__pyx_optional_args) {
  double __pyx_v_fm_index = ((double)1.0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contrast_enhancement", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm_index = __pyx_optional_args->fm_index;
    }
  }
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_111contrast_enhancement(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_110contrast_enhancement, "\n    returns insig (index 1.0)): sin(sig * pi / 2 + fm_index * sin(sig * 2 * pi))\n    contrast_enhancement passes its input to sin as a kind of phase modulation.\n    \n    :param insig: input\n    :param fm_index: \n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_111contrast_enhancement = {"contrast_enhancement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_111contrast_enhancement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_110contrast_enhancement};
static PyObject *__pyx_pw_8pysndlib_3clm_111contrast_enhancement(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_insig;
  double __pyx_v_fm_index;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contrast_enhancement (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_insig,&__pyx_n_s_fm_index,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm_index);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "contrast_enhancement") < 0)) __PYX_ERR(0, 1277, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_fm_index = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fm_index == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L3_error)
    } else {
      __pyx_v_fm_index = ((double)1.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contrast_enhancement", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1277, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.contrast_enhancement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_110contrast_enhancement(__pyx_self, __pyx_v_insig, __pyx_v_fm_index);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_110contrast_enhancement(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_insig, double __pyx_v_fm_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contrast_enhancement", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm_index = __pyx_v_fm_index;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_contrast_enhancement(__pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.contrast_enhancement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__199 = PyTuple_Pack(2, __pyx_n_s_insig, __pyx_n_s_fm_index); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_contrast_enhancement, 1277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 1277, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm_index, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_111contrast_enhancement, 0, __pyx_n_s_contrast_enhancement, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__201);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_contrast_enhancement, __pyx_t_40) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_float_1_0); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_contrast_enhancement {
  int __pyx_n;
  double fm_index;
};
 1278:     """
 1279:     returns insig (index 1.0)): sin(sig * pi / 2 + fm_index * sin(sig * 2 * pi))
 1280:     contrast_enhancement passes its input to sin as a kind of phase modulation.
 1281:     
 1282:     :param insig: input
 1283:     :param fm_index: 
 1284:     :return: result
 1285:     :rtype: float
 1286:     
 1287:     """
+1288:     return cclm.mus_contrast_enhancement(insig, fm_index)
  __pyx_r = mus_contrast_enhancement(__pyx_v_insig, __pyx_v_fm_index);
  goto __pyx_L0;
 1289: 
 1290: 
+1291: cpdef cython.double dot_product(data1: npt.NDArray[np.float64], data2: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_113dot_product(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_dot_product(PyObject *__pyx_v_data1, PyObject *__pyx_v_data2, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_data1_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_data2_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dot_product", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.dot_product", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data1_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data2_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_113dot_product(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_112dot_product, "\n    returns v1 v2 (size)): sum of v1[i] * v2[i] (also named scalar product).\n    \n    :param data1: input 1\n    :param data2: input 2\n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_113dot_product = {"dot_product", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_113dot_product, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_112dot_product};
static PyObject *__pyx_pw_8pysndlib_3clm_113dot_product(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data1 = 0;
  PyObject *__pyx_v_data2 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dot_product (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data1,&__pyx_n_s_data2,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("dot_product", 1, 2, 2, 1); __PYX_ERR(0, 1291, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dot_product") < 0)) __PYX_ERR(0, 1291, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_data1 = values[0];
    __pyx_v_data2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dot_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1291, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.dot_product", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_112dot_product(__pyx_self, __pyx_v_data1, __pyx_v_data2);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_112dot_product(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data1, PyObject *__pyx_v_data2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dot_product", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_dot_product(__pyx_v_data1, __pyx_v_data2, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.dot_product", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__202 = PyTuple_Pack(2, __pyx_n_s_data1, __pyx_n_s_data2); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_data1, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_data2, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_113dot_product, 0, __pyx_n_s_dot_product, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dot_product, __pyx_t_37) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_dot_product, 1291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1291, __pyx_L1_error)
 1292:     """
 1293:     returns v1 v2 (size)): sum of v1[i] * v2[i] (also named scalar product).
 1294:     
 1295:     :param data1: input 1
 1296:     :param data2: input 2
 1297:     :return: result
 1298:     :rtype: float
 1299:     
 1300:     """
+1301:     check_ndim(data1)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1302:     check_ndim(data2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1303:     compare_shapes(data1, data2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_data1, __pyx_v_data2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1304: 
+1305:     cdef double [:] data1_view = data1
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __pyx_v_data1_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1306:     cdef double [:] data2_view = data2
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __pyx_v_data2_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1307:     return cclm.mus_dot_product(&data1_view[0], &data2_view[0], len(data1))
  __pyx_t_6 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_v_data1_view.shape[0];
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_v_data1_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1307, __pyx_L1_error)
  }
  __pyx_t_7 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_data2_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_data2_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1307, __pyx_L1_error)
  }
  __pyx_t_8 = PyObject_Length(__pyx_v_data1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1307, __pyx_L1_error)
  __pyx_r = mus_dot_product((&(*((double *) ( /* dim=0 */ (__pyx_v_data1_view.data + __pyx_t_6 * __pyx_v_data1_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_data2_view.data + __pyx_t_7 * __pyx_v_data2_view.strides[0]) )))), __pyx_t_8);
  goto __pyx_L0;
 1308: 
+1309: cpdef cython.double polynomial(coeffs: npt.NDArray[np.float64], x: cython.double ):
static PyObject *__pyx_pw_8pysndlib_3clm_115polynomial(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_polynomial(PyObject *__pyx_v_coeffs, double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_coeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polynomial", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.polynomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_coeffs_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_115polynomial(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_114polynomial, "\n    evaluate a polynomial at x.  coeffs are in order of degree, so coeff[0] is the constant term.\n    \n    :param coeffs: coefficients where coeffs[0] is the constant term, and so on.\n    :param x: input\n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_115polynomial = {"polynomial", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_115polynomial, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_114polynomial};
static PyObject *__pyx_pw_8pysndlib_3clm_115polynomial(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_coeffs = 0;
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polynomial (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coeffs,&__pyx_n_s_x,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("polynomial", 1, 2, 2, 1); __PYX_ERR(0, 1309, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polynomial") < 0)) __PYX_ERR(0, 1309, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_coeffs = values[0];
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("polynomial", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1309, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.polynomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_114polynomial(__pyx_self, __pyx_v_coeffs, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_114polynomial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_coeffs, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polynomial", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_polynomial(__pyx_v_coeffs, __pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.polynomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_coeffs, __pyx_n_s_x); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_coeffs, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1309, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1309, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_115polynomial, 0, __pyx_n_s_polynomial, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_polynomial, __pyx_t_40) < 0) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_polynomial, 1309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1309, __pyx_L1_error)
 1310:     """
 1311:     evaluate a polynomial at x.  coeffs are in order of degree, so coeff[0] is the constant term.
 1312:     
 1313:     :param coeffs: coefficients where coeffs[0] is the constant term, and so on.
 1314:     :param x: input
 1315:     :return: result
 1316:     :rtype: float
 1317:     
 1318:     """
+1319:     check_ndim(coeffs)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_coeffs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1320:     cdef double [:] coeffs_view = coeffs
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_coeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __pyx_v_coeffs_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1321:     return cclm.mus_polynomial(&coeffs_view[0], x, len(coeffs))
  __pyx_t_6 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_v_coeffs_view.shape[0];
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_v_coeffs_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1321, __pyx_L1_error)
  }
  __pyx_t_7 = PyObject_Length(__pyx_v_coeffs); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1321, __pyx_L1_error)
  __pyx_r = mus_polynomial((&(*((double *) ( /* dim=0 */ (__pyx_v_coeffs_view.data + __pyx_t_6 * __pyx_v_coeffs_view.strides[0]) )))), __pyx_v_x, __pyx_t_7);
  goto __pyx_L0;
 1322: 
+1323: cpdef cython.double array_interp(fn: npt.NDArray[np.float64], x: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_117array_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_array_interp(PyObject *__pyx_v_fn, double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_fn_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_interp", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.array_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_fn_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_117array_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_116array_interp, "\n    taking into account wrap-around (size is size of data), with linear interpolation if phase is not an integer.\n    \n    :param fn: input array\n    :param x: interp point\n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_117array_interp = {"array_interp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_117array_interp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_116array_interp};
static PyObject *__pyx_pw_8pysndlib_3clm_117array_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fn = 0;
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_interp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fn,&__pyx_n_s_x,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fn)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1323, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1323, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("array_interp", 1, 2, 2, 1); __PYX_ERR(0, 1323, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "array_interp") < 0)) __PYX_ERR(0, 1323, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_fn = values[0];
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1323, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("array_interp", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1323, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_116array_interp(__pyx_self, __pyx_v_fn, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_116array_interp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fn, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_interp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_array_interp(__pyx_v_fn, __pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1323, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.array_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__206 = PyTuple_Pack(2, __pyx_n_s_fn, __pyx_n_s_x); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_fn, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1323, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_117array_interp, 0, __pyx_n_s_array_interp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_interp, __pyx_t_37) < 0) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_array_interp, 1323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1323, __pyx_L1_error)
 1324:     """
 1325:     taking into account wrap-around (size is size of data), with linear interpolation if phase is not an integer.
 1326:     
 1327:     :param fn: input array
 1328:     :param x: interp point
 1329:     :return: result
 1330:     :rtype: float
 1331:     
 1332:     """
+1333:     check_ndim(fn)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_fn};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1334:     cdef double [:] fn_view = fn
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_fn, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1334, __pyx_L1_error)
  __pyx_v_fn_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1335:     return cclm.mus_array_interp(&fn_view[0], x, len(fn))
  __pyx_t_6 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_v_fn_view.shape[0];
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_v_fn_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1335, __pyx_L1_error)
  }
  __pyx_t_7 = PyObject_Length(__pyx_v_fn); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1335, __pyx_L1_error)
  __pyx_r = mus_array_interp((&(*((double *) ( /* dim=0 */ (__pyx_v_fn_view.data + __pyx_t_6 * __pyx_v_fn_view.strides[0]) )))), __pyx_v_x, __pyx_t_7);
  goto __pyx_L0;
 1336: 
+1337: cpdef cython.double bessi0(x: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_119bessi0(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_bessi0(double __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bessi0", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_119bessi0(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_118bessi0, "\n    bessel function of zeroth order\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_119bessi0 = {"bessi0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_119bessi0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_118bessi0};
static PyObject *__pyx_pw_8pysndlib_3clm_119bessi0(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bessi0 (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bessi0") < 0)) __PYX_ERR(0, 1337, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bessi0", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1337, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.bessi0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_118bessi0(__pyx_self, __pyx_v_x);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_118bessi0(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bessi0", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_bessi0(__pyx_v_x, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.bessi0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1337, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_119bessi0, 0, __pyx_n_s_bessi0, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bessi0, __pyx_t_40) < 0) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_bessi0, 1337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 1337, __pyx_L1_error)
 1338:     """
 1339:     bessel function of zeroth order
 1340:     """
+1341:     return cclm.mus_bessi0(x)
  __pyx_r = mus_bessi0(__pyx_v_x);
  goto __pyx_L0;
 1342: 
+1343: cpdef cython.double mus_interpolate(interp_type: Interp, x: cython.double, table: npt.NDArray[np.float64], y1: cython.double = 0.):
static PyObject *__pyx_pw_8pysndlib_3clm_121mus_interpolate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_mus_interpolate(enum __pyx_t_8pysndlib_3clm_Interp __pyx_v_interp_type, double __pyx_v_x, PyObject *__pyx_v_table, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_mus_interpolate *__pyx_optional_args) {
  double __pyx_v_y1 = ((double)0.);
  __Pyx_memviewslice __pyx_v_table_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_interpolate", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_y1 = __pyx_optional_args->y1;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.mus_interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_table_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_121mus_interpolate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_120mus_interpolate, "\n    interpolate in data ('table' is a ndarray) using interpolation 'type', such as Interp.linear.\n    \n    :param interp_type: type of interpolation\n    :param x: interpolation value\n    :param table: table to interpolate in\n    :return: result\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_121mus_interpolate = {"mus_interpolate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_121mus_interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_120mus_interpolate};
static PyObject *__pyx_pw_8pysndlib_3clm_121mus_interpolate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  enum __pyx_t_8pysndlib_3clm_Interp __pyx_v_interp_type;
  double __pyx_v_x;
  PyObject *__pyx_v_table = 0;
  double __pyx_v_y1;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_interpolate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interp_type,&__pyx_n_s_x,&__pyx_n_s_table,&__pyx_n_s_y1,0};
    PyObject* values[4] = {0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("mus_interpolate", 0, 3, 4, 1); __PYX_ERR(0, 1343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("mus_interpolate", 0, 3, 4, 2); __PYX_ERR(0, 1343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mus_interpolate") < 0)) __PYX_ERR(0, 1343, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_interp_type = ((enum __pyx_t_8pysndlib_3clm_Interp)__Pyx_PyInt_As_enum____pyx_t_8pysndlib_3clm_Interp(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
    __pyx_v_table = values[2];
    if (values[3]) {
      __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
    } else {
      __pyx_v_y1 = ((double)0.);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mus_interpolate", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 1343, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_120mus_interpolate(__pyx_self, __pyx_v_interp_type, __pyx_v_x, __pyx_v_table, __pyx_v_y1);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_120mus_interpolate(CYTHON_UNUSED PyObject *__pyx_self, enum __pyx_t_8pysndlib_3clm_Interp __pyx_v_interp_type, double __pyx_v_x, PyObject *__pyx_v_table, double __pyx_v_y1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_interpolate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.y1 = __pyx_v_y1;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_mus_interpolate(__pyx_v_interp_type, __pyx_v_x, __pyx_v_table, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.mus_interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__209 = PyTuple_Pack(4, __pyx_n_s_interp_type, __pyx_n_s_x, __pyx_n_s_table, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_mus_interpolate, 1343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 1343, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_interp_type, __pyx_n_s_Interp) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_table, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_y1, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_121mus_interpolate, 0, __pyx_n_s_mus_interpolate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__211);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mus_interpolate, __pyx_t_37) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_float_0_); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_mus_interpolate {
  int __pyx_n;
  double y1;
};
 1344:     """
 1345:     interpolate in data ('table' is a ndarray) using interpolation 'type', such as Interp.linear.
 1346:     
 1347:     :param interp_type: type of interpolation
 1348:     :param x: interpolation value
 1349:     :param table: table to interpolate in
 1350:     :return: result
 1351:     :rtype: float
 1352:     
 1353:     """
+1354:     check_ndim(table)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_table};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1355:     cdef double [:] table_view = table
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_table, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __pyx_v_table_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1356:     return cclm.mus_interpolate(<cclm.mus_interp_t>interp_type, x, &table_view[0], len(table), y1)
  __pyx_t_6 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_v_table_view.shape[0];
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_v_table_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1356, __pyx_L1_error)
  }
  __pyx_t_7 = PyObject_Length(__pyx_v_table); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1356, __pyx_L1_error)
  __pyx_r = mus_interpolate(((mus_interp_t)__pyx_v_interp_type), __pyx_v_x, (&(*((double *) ( /* dim=0 */ (__pyx_v_table_view.data + __pyx_t_6 * __pyx_v_table_view.strides[0]) )))), __pyx_t_7, __pyx_v_y1);
  goto __pyx_L0;
 1357: 
+1358: cpdef np.ndarray mus_fft(rdat: npt.NDArray[np.float64], idat: npt.NDArray[np.float64], fft_size: int, sign: int):
static PyObject *__pyx_pw_8pysndlib_3clm_123mus_fft(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_mus_fft(PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, PyObject *__pyx_v_fft_size, PyObject *__pyx_v_sign, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_rdat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_idat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED PyObject *__pyx_v_res = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_fft", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.mus_fft", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rdat_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_idat_view, 1);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_123mus_fft(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_122mus_fft, "\n    return the fft of rl and im which contain the real and imaginary parts of the data; len should be a\n    power of 2, dir = 1 for fft, -1 for inverse-fft.\n    \n    :param rdat: real data\n    :param imaginary: imaginary data\n    :param fft_size: must be power of two\n    :param sign: 1 for fft, -1 for inverse-fft\n    :return: result written into rdat\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_123mus_fft = {"mus_fft", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_123mus_fft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_122mus_fft};
static PyObject *__pyx_pw_8pysndlib_3clm_123mus_fft(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rdat = 0;
  PyObject *__pyx_v_idat = 0;
  PyObject *__pyx_v_fft_size = 0;
  PyObject *__pyx_v_sign = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_fft (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rdat,&__pyx_n_s_idat,&__pyx_n_s_fft_size,&__pyx_n_s_sign,0};
    PyObject* values[4] = {0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rdat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("mus_fft", 1, 4, 4, 1); __PYX_ERR(0, 1358, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fft_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("mus_fft", 1, 4, 4, 2); __PYX_ERR(0, 1358, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sign)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("mus_fft", 1, 4, 4, 3); __PYX_ERR(0, 1358, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mus_fft") < 0)) __PYX_ERR(0, 1358, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_rdat = values[0];
    __pyx_v_idat = values[1];
    __pyx_v_fft_size = ((PyObject*)values[2]);
    __pyx_v_sign = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mus_fft", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1358, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.mus_fft", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fft_size), (&PyInt_Type), 0, "fft_size", 1))) __PYX_ERR(0, 1358, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sign), (&PyInt_Type), 0, "sign", 1))) __PYX_ERR(0, 1358, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_122mus_fft(__pyx_self, __pyx_v_rdat, __pyx_v_idat, __pyx_v_fft_size, __pyx_v_sign);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_122mus_fft(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, PyObject *__pyx_v_fft_size, PyObject *__pyx_v_sign) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mus_fft", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_mus_fft(__pyx_v_rdat, __pyx_v_idat, __pyx_v_fft_size, __pyx_v_sign, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.mus_fft", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__212 = PyTuple_Pack(4, __pyx_n_s_rdat, __pyx_n_s_idat, __pyx_n_s_fft_size, __pyx_n_s_sign); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_rdat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_idat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fft_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_sign, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_123mus_fft, 0, __pyx_n_s_mus_fft, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mus_fft, __pyx_t_40) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_mus_fft, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1358, __pyx_L1_error)
 1359:     """
 1360:     return the fft of rl and im which contain the real and imaginary parts of the data; len should be a
 1361:     power of 2, dir = 1 for fft, -1 for inverse-fft.
 1362:     
 1363:     :param rdat: real data
 1364:     :param imaginary: imaginary data
 1365:     :param fft_size: must be power of two
 1366:     :param sign: 1 for fft, -1 for inverse-fft
 1367:     :return: result written into rdat
 1368:     :rtype: np.ndarray
 1369:     
 1370:     """
+1371:     check_ndim(rdat)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_rdat};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1372:     check_ndim(idat)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_idat};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1373:     compare_shapes(rdat, idat)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_rdat, __pyx_v_idat};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1374: 
+1375:     cdef double [:] rdat_view = rdat
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rdat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __pyx_v_rdat_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1376:     cdef double [:] idat_view = idat
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_idat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1376, __pyx_L1_error)
  __pyx_v_idat_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1377:     res = cclm.mus_fft(&rdat_view[0], &idat_view[0], fft_size, sign)
  __pyx_t_6 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_v_rdat_view.shape[0];
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_v_rdat_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1377, __pyx_L1_error)
  }
  __pyx_t_7 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_idat_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_idat_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1377, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyInt_As_mus_long_t(__pyx_v_fft_size); if (unlikely((__pyx_t_8 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_sign); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(mus_fft((&(*((double *) ( /* dim=0 */ (__pyx_v_rdat_view.data + __pyx_t_6 * __pyx_v_rdat_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_idat_view.data + __pyx_t_7 * __pyx_v_idat_view.strides[0]) )))), __pyx_t_8, __pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;
+1378:     return rdat
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_rdat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rdat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_rdat);
  __pyx_r = ((PyArrayObject *)__pyx_v_rdat);
  goto __pyx_L0;
 1379: 
+1380: cpdef np.ndarray make_fft_window(window_type: Window, size: int, beta: Optional[float]=0.0, alpha: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_125make_fft_window(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_make_fft_window(enum __pyx_t_8pysndlib_3clm_Window __pyx_v_window_type, PyObject *__pyx_v_size, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_fft_window *__pyx_optional_args) {
  PyObject *__pyx_v_beta = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_alpha = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_win = NULL;
  __Pyx_memviewslice __pyx_v_win_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fft_window", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_beta = __pyx_optional_args->beta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_alpha = __pyx_optional_args->alpha;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_fft_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_win);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_win_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_125make_fft_window(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_124make_fft_window, "\n    fft data window (a ndarray). type is one of the sndlib fft window identifiers such as\n    window.kaiser, beta is the window family parameter, if any.\n    \n    :param window_type: type of window\n    :param size: window size\n    :param beta: beta parameter if needed\n    :param alpha: alpha parameter if needed\n    :return: window\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_125make_fft_window = {"make_fft_window", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_125make_fft_window, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_124make_fft_window};
static PyObject *__pyx_pw_8pysndlib_3clm_125make_fft_window(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  enum __pyx_t_8pysndlib_3clm_Window __pyx_v_window_type;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_beta = 0;
  PyObject *__pyx_v_alpha = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fft_window (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window_type,&__pyx_n_s_size,&__pyx_n_s_beta,&__pyx_n_s_alpha,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_float_0_0);
    values[3] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window_type)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_fft_window", 0, 2, 4, 1); __PYX_ERR(0, 1380, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_beta);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_fft_window") < 0)) __PYX_ERR(0, 1380, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_window_type = ((enum __pyx_t_8pysndlib_3clm_Window)__Pyx_PyInt_As_enum____pyx_t_8pysndlib_3clm_Window(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L3_error)
    __pyx_v_size = ((PyObject*)values[1]);
    __pyx_v_beta = values[2];
    __pyx_v_alpha = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_fft_window", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1380, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_fft_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 1380, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_124make_fft_window(__pyx_self, __pyx_v_window_type, __pyx_v_size, __pyx_v_beta, __pyx_v_alpha);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_124make_fft_window(CYTHON_UNUSED PyObject *__pyx_self, enum __pyx_t_8pysndlib_3clm_Window __pyx_v_window_type, PyObject *__pyx_v_size, PyObject *__pyx_v_beta, PyObject *__pyx_v_alpha) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fft_window", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.beta = __pyx_v_beta;
  __pyx_t_2.alpha = __pyx_v_alpha;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_fft_window(__pyx_v_window_type, __pyx_v_size, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_fft_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__214 = PyTuple_Pack(4, __pyx_n_s_window_type, __pyx_n_s_size, __pyx_n_s_beta, __pyx_n_s_alpha); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_fft_window, 1380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1380, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_window_type, __pyx_n_s_Window) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_beta, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_alpha, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_125make_fft_window, 0, __pyx_n_s_make_fft_window, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__216);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_fft_window, __pyx_t_37) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__216 = PyTuple_Pack(2, __pyx_float_0_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_fft_window {
  int __pyx_n;
  PyObject *beta;
  PyObject *alpha;
};
 1381:     """
 1382:     fft data window (a ndarray). type is one of the sndlib fft window identifiers such as
 1383:     window.kaiser, beta is the window family parameter, if any.
 1384:     
 1385:     :param window_type: type of window
 1386:     :param size: window size
 1387:     :param beta: beta parameter if needed
 1388:     :param alpha: alpha parameter if needed
 1389:     :return: window
 1390:     :rtype: np.ndarray
 1391:     
 1392:     """
+1393:     win = np.zeros(size, dtype=np.double)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_size);
  __Pyx_GIVEREF(__pyx_v_size);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_win = __pyx_t_5;
  __pyx_t_5 = 0;
+1394:     check_ndim(win)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_win};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 1395: 
+1396:     cdef double [:] win_view = win
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_win, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __pyx_v_win_view = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;
+1397:     cclm.mus_make_fft_window_with_window(<cclm.mus_fft_window_t>window_type, size, beta, alpha, &win_view[0])
  __pyx_t_8 = __Pyx_PyInt_As_mus_long_t(__pyx_v_size); if (unlikely((__pyx_t_8 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_beta); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L1_error)
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_alpha); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L1_error)
  __pyx_t_11 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_win_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_win_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1397, __pyx_L1_error)
  }
  (void)(mus_make_fft_window_with_window(((mus_fft_window_t)__pyx_v_window_type), __pyx_t_8, __pyx_t_9, __pyx_t_10, (&(*((double *) ( /* dim=0 */ (__pyx_v_win_view.data + __pyx_t_11 * __pyx_v_win_view.strides[0]) ))))));
+1398:     return win
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_win) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_win, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_win);
  __pyx_r = ((PyArrayObject *)__pyx_v_win);
  goto __pyx_L0;
 1399: 
+1400: cpdef np.ndarray rectangular2polar(rdat: npt.NDArray[np.float64], idat: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_127rectangular2polar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_rectangular2polar(PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_rdat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_idat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED PyObject *__pyx_v_res = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rectangular2polar", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_AddTraceback("pysndlib.clm.rectangular2polar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rdat_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_idat_view, 1);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_127rectangular2polar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_126rectangular2polar, "\n    convert real/imaginary data in s rl and im from rectangular form (fft output) to polar form (a\n    spectrum).\n    \n    :param rdat: real data\n    :param imaginary:  imaginary data\n    :return: magnitude written into rdat, idat contains phases\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_127rectangular2polar = {"rectangular2polar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_127rectangular2polar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_126rectangular2polar};
static PyObject *__pyx_pw_8pysndlib_3clm_127rectangular2polar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rdat = 0;
  PyObject *__pyx_v_idat = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rectangular2polar (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rdat,&__pyx_n_s_idat,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rdat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1400, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1400, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("rectangular2polar", 1, 2, 2, 1); __PYX_ERR(0, 1400, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rectangular2polar") < 0)) __PYX_ERR(0, 1400, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_rdat = values[0];
    __pyx_v_idat = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rectangular2polar", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1400, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.rectangular2polar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_126rectangular2polar(__pyx_self, __pyx_v_rdat, __pyx_v_idat);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_126rectangular2polar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rectangular2polar", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_rectangular2polar(__pyx_v_rdat, __pyx_v_idat, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.rectangular2polar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__217 = PyTuple_Pack(2, __pyx_n_s_rdat, __pyx_n_s_idat); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_rdat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_idat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_127rectangular2polar, 0, __pyx_n_s_rectangular2polar, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangular2polar, __pyx_t_40) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_rectangular2polar, 1400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 1400, __pyx_L1_error)
 1401:     """
 1402:     convert real/imaginary data in s rl and im from rectangular form (fft output) to polar form (a
 1403:     spectrum).
 1404:     
 1405:     :param rdat: real data
 1406:     :param imaginary:  imaginary data
 1407:     :return: magnitude written into rdat, idat contains phases
 1408:     :rtype: np.ndarray
 1409:     
 1410:     """
+1411:     size = len(rdat)
  __pyx_t_1 = PyObject_Length(__pyx_v_rdat); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1411, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
 1412: 
+1413:     check_ndim(rdat)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_rdat};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1414:     check_ndim(idat)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_idat};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1415:     compare_shapes(rdat, idat)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_rdat, __pyx_v_idat};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 1416: 
+1417:     cdef double [:] rdat_view = rdat
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rdat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __pyx_v_rdat_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
+1418:     cdef double [:] idat_view = idat
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_idat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __pyx_v_idat_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
+1419:     res = cclm.mus_rectangular_to_polar(&rdat_view[0], &idat_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_rdat_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_rdat_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 1419, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_idat_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_idat_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 1419, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_void_to_None(mus_rectangular_to_polar((&(*((double *) ( /* dim=0 */ (__pyx_v_rdat_view.data + __pyx_t_7 * __pyx_v_rdat_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_idat_view.data + __pyx_t_8 * __pyx_v_idat_view.strides[0]) )))), __pyx_v_size)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;
+1420:     return rdat
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_rdat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rdat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_rdat);
  __pyx_r = ((PyArrayObject *)__pyx_v_rdat);
  goto __pyx_L0;
 1421: 
+1422: cpdef np.ndarray rectangular2magnitudes(rdat: npt.NDArray[np.float64], idat: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_129rectangular2magnitudes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_rectangular2magnitudes(PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_rdat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_idat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rectangular2magnitudes", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.rectangular2magnitudes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rdat_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_idat_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_129rectangular2magnitudes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_128rectangular2magnitudes, "\n    convert real/imaginary data in rl and im from rectangular form (fft output) to polar form, but\n    ignore the phases.\n    \n    :param rdat: real data\n    :param imaginary:  imaginary data\n    :return: magnitude written into rdat\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_129rectangular2magnitudes = {"rectangular2magnitudes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_129rectangular2magnitudes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_128rectangular2magnitudes};
static PyObject *__pyx_pw_8pysndlib_3clm_129rectangular2magnitudes(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rdat = 0;
  PyObject *__pyx_v_idat = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rectangular2magnitudes (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rdat,&__pyx_n_s_idat,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rdat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1422, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1422, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("rectangular2magnitudes", 1, 2, 2, 1); __PYX_ERR(0, 1422, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rectangular2magnitudes") < 0)) __PYX_ERR(0, 1422, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_rdat = values[0];
    __pyx_v_idat = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rectangular2magnitudes", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1422, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.rectangular2magnitudes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_128rectangular2magnitudes(__pyx_self, __pyx_v_rdat, __pyx_v_idat);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_128rectangular2magnitudes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rectangular2magnitudes", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_rectangular2magnitudes(__pyx_v_rdat, __pyx_v_idat, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.rectangular2magnitudes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_rdat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_idat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_129rectangular2magnitudes, 0, __pyx_n_s_rectangular2magnitudes, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangular2magnitudes, __pyx_t_37) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_rectangular2magnitudes, 1422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1422, __pyx_L1_error)
 1423:     """
 1424:     convert real/imaginary data in rl and im from rectangular form (fft output) to polar form, but
 1425:     ignore the phases.
 1426:     
 1427:     :param rdat: real data
 1428:     :param imaginary:  imaginary data
 1429:     :return: magnitude written into rdat
 1430:     :rtype: np.ndarray
 1431:     
 1432:     """
+1433:     size = len(rdat)
  __pyx_t_1 = PyObject_Length(__pyx_v_rdat); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1433, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
+1434:     cdef double [:] rdat_view = rdat
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rdat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __pyx_v_rdat_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+1435:     cdef double [:] idat_view = idat
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_idat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1435, __pyx_L1_error)
  __pyx_v_idat_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+1436:     compare_shapes(rdat, idat)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_rdat, __pyx_v_idat};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 1437: 
+1438:     cclm.mus_rectangular_to_magnitudes(&rdat_view[0], &idat_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_rdat_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_rdat_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1438, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_idat_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_idat_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1438, __pyx_L1_error)
  }
  mus_rectangular_to_magnitudes((&(*((double *) ( /* dim=0 */ (__pyx_v_rdat_view.data + __pyx_t_7 * __pyx_v_rdat_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_idat_view.data + __pyx_t_8 * __pyx_v_idat_view.strides[0]) )))), __pyx_v_size);
+1439:     return rdat
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_rdat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rdat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_rdat);
  __pyx_r = ((PyArrayObject *)__pyx_v_rdat);
  goto __pyx_L0;
 1440: 
+1441: cpdef np.ndarray polar2rectangular(rdat: npt.NDArray[np.float64], idat: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_131polar2rectangular(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_polar2rectangular(PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_rdat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_idat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polar2rectangular", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.polar2rectangular", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rdat_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_idat_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_131polar2rectangular(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_130polar2rectangular, "\n    convert real/imaginary data in rl and im from polar (spectrum) to rectangular (fft).\n    \n    :param rdat: magnitude data\n    :param imaginary: phases data\n    :return: real data written into rdat, idat contains imaginary\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_131polar2rectangular = {"polar2rectangular", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_131polar2rectangular, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_130polar2rectangular};
static PyObject *__pyx_pw_8pysndlib_3clm_131polar2rectangular(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rdat = 0;
  PyObject *__pyx_v_idat = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polar2rectangular (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rdat,&__pyx_n_s_idat,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rdat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1441, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1441, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("polar2rectangular", 1, 2, 2, 1); __PYX_ERR(0, 1441, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polar2rectangular") < 0)) __PYX_ERR(0, 1441, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_rdat = values[0];
    __pyx_v_idat = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("polar2rectangular", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1441, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.polar2rectangular", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_130polar2rectangular(__pyx_self, __pyx_v_rdat, __pyx_v_idat);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_130polar2rectangular(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polar2rectangular", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_polar2rectangular(__pyx_v_rdat, __pyx_v_idat, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.polar2rectangular", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_rdat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_idat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_131polar2rectangular, 0, __pyx_n_s_polar2rectangular, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_polar2rectangular, __pyx_t_40) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_polar2rectangular, 1441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 1441, __pyx_L1_error)
 1442:     """
 1443:     convert real/imaginary data in rl and im from polar (spectrum) to rectangular (fft).
 1444:     
 1445:     :param rdat: magnitude data
 1446:     :param imaginary: phases data
 1447:     :return: real data written into rdat, idat contains imaginary
 1448:     :rtype: np.ndarray
 1449:     
 1450:     """
+1451:     size = len(rdat)
  __pyx_t_1 = PyObject_Length(__pyx_v_rdat); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1451, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
+1452:     cdef double [:] rdat_view = rdat
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rdat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __pyx_v_rdat_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+1453:     cdef double [:] idat_view = idat
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_idat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __pyx_v_idat_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+1454:     compare_shapes(rdat, idat)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_rdat, __pyx_v_idat};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 1455: 
+1456:     cclm.mus_polar_to_rectangular(&rdat_view[0], &idat_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_rdat_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_rdat_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1456, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_idat_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_idat_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1456, __pyx_L1_error)
  }
  mus_polar_to_rectangular((&(*((double *) ( /* dim=0 */ (__pyx_v_rdat_view.data + __pyx_t_7 * __pyx_v_rdat_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_idat_view.data + __pyx_t_8 * __pyx_v_idat_view.strides[0]) )))), __pyx_v_size);
+1457:     return rdat
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_rdat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rdat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1457, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_rdat);
  __pyx_r = ((PyArrayObject *)__pyx_v_rdat);
  goto __pyx_L0;
 1458: 
+1459: cpdef np.ndarray spectrum(rdat: npt.NDArray[np.float64], idat: npt.NDArray[np.float64], window: npt.NDArray[np.cython.double64], norm_type: Spectrum):
static PyObject *__pyx_pw_8pysndlib_3clm_133spectrum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_spectrum(PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, PyObject *__pyx_v_window, enum __pyx_t_8pysndlib_3clm_Spectrum __pyx_v_norm_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_rdat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_idat_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_window_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spectrum", 0);
  __Pyx_INCREF(__pyx_v_window);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.spectrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rdat_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_idat_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_window_view, 1);
  __Pyx_XDECREF(__pyx_v_window);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_133spectrum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_132spectrum, "\n    real and imaginary data in ndarrays rl and im, returns (in rl) the spectrum thereof; window is the\n    fft data window (a ndarray as returned by make_fft_window  and type determines how the spectral data is\n    scaled:\n    spectrum.in_db= data in db,\n    spectrum.normalized (default) = linear and normalized\n    spectrum.raw = linear and un-normalized.\n    \n    :param rdat: real data\n    :param imaginary: imaginary data\n    :param window: fft window\n    :param norm_type: normalization type\n    :return: spectrum\n    :rtype: np.ndarray\n              \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_133spectrum = {"spectrum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_133spectrum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_132spectrum};
static PyObject *__pyx_pw_8pysndlib_3clm_133spectrum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rdat = 0;
  PyObject *__pyx_v_idat = 0;
  PyObject *__pyx_v_window = 0;
  enum __pyx_t_8pysndlib_3clm_Spectrum __pyx_v_norm_type;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spectrum (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rdat,&__pyx_n_s_idat,&__pyx_n_s_window,&__pyx_n_s_norm_type,0};
    PyObject* values[4] = {0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rdat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idat)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("spectrum", 1, 4, 4, 1); __PYX_ERR(0, 1459, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("spectrum", 1, 4, 4, 2); __PYX_ERR(0, 1459, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm_type)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("spectrum", 1, 4, 4, 3); __PYX_ERR(0, 1459, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "spectrum") < 0)) __PYX_ERR(0, 1459, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_rdat = values[0];
    __pyx_v_idat = values[1];
    __pyx_v_window = values[2];
    __pyx_v_norm_type = ((enum __pyx_t_8pysndlib_3clm_Spectrum)__Pyx_PyInt_As_enum____pyx_t_8pysndlib_3clm_Spectrum(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spectrum", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1459, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.spectrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_132spectrum(__pyx_self, __pyx_v_rdat, __pyx_v_idat, __pyx_v_window, __pyx_v_norm_type);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_132spectrum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rdat, PyObject *__pyx_v_idat, PyObject *__pyx_v_window, enum __pyx_t_8pysndlib_3clm_Spectrum __pyx_v_norm_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spectrum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_spectrum(__pyx_v_rdat, __pyx_v_idat, __pyx_v_window, __pyx_v_norm_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.spectrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__221 = PyTuple_Pack(4, __pyx_n_s_rdat, __pyx_n_s_idat, __pyx_n_s_window, __pyx_n_s_norm_type); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_rdat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_idat, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_window, __pyx_kp_s_npt_NDArray_np_cython_double64) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_norm_type, __pyx_n_s_Spectrum) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_133spectrum, 0, __pyx_n_s_spectrum, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_spectrum, __pyx_t_37) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_spectrum, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 1459, __pyx_L1_error)
 1460:     """
 1461:     real and imaginary data in ndarrays rl and im, returns (in rl) the spectrum thereof; window is the
 1462:     fft data window (a ndarray as returned by make_fft_window  and type determines how the spectral data is
 1463:     scaled:
 1464:     spectrum.in_db= data in db,
 1465:     spectrum.normalized (default) = linear and normalized
 1466:     spectrum.raw = linear and un-normalized.
 1467:     
 1468:     :param rdat: real data
 1469:     :param imaginary: imaginary data
 1470:     :param window: fft window
 1471:     :param norm_type: normalization type
 1472:     :return: spectrum
 1473:     :rtype: np.ndarray
 1474:               
 1475:     """
+1476:     if isinstance(window, list):
  __pyx_t_1 = PyList_Check(__pyx_v_window); 
  if (__pyx_t_1) {
/* … */
  }
+1477:         window = np.array(window, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_window);
    __Pyx_GIVEREF(__pyx_v_window);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_window);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_window, __pyx_t_6);
    __pyx_t_6 = 0;
+1478:     size = len(rdat)
  __pyx_t_7 = PyObject_Length(__pyx_v_rdat); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_v_size = __pyx_t_7;
+1479:     cdef double [:] rdat_view = rdat
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rdat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1479, __pyx_L1_error)
  __pyx_v_rdat_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
+1480:     cdef double [:] idat_view = idat
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_idat, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __pyx_v_idat_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
+1481:     cdef double [:] window_view = window
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_window, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __pyx_v_window_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 1482: 
+1483:     check_ndim(rdat)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_rdat};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1484:     check_ndim(idat)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_idat};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1485:     check_ndim(window)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_window};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1486:     compare_shapes(rdat, idat)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_rdat, __pyx_v_idat};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1487: 
+1488:     cclm.mus_spectrum(&rdat_view[0], &idat_view[0], &window_view[0], size, <cclm.mus_spectrum_t>norm_type)
  __pyx_t_10 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_v_rdat_view.shape[0];
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_v_rdat_view.shape[0])) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    __PYX_ERR(0, 1488, __pyx_L1_error)
  }
  __pyx_t_11 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_idat_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_idat_view.shape[0])) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    __PYX_ERR(0, 1488, __pyx_L1_error)
  }
  __pyx_t_12 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_window_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_window_view.shape[0])) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    __PYX_ERR(0, 1488, __pyx_L1_error)
  }
  (void)(mus_spectrum((&(*((double *) ( /* dim=0 */ (__pyx_v_rdat_view.data + __pyx_t_10 * __pyx_v_rdat_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_idat_view.data + __pyx_t_11 * __pyx_v_idat_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_window_view.data + __pyx_t_12 * __pyx_v_window_view.strides[0]) )))), __pyx_v_size, ((mus_spectrum_t)__pyx_v_norm_type)));
+1489:     return rdat
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_rdat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rdat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1489, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_rdat);
  __pyx_r = ((PyArrayObject *)__pyx_v_rdat);
  goto __pyx_L0;
 1490: 
+1491: cpdef np.ndarray convolution(rl1: npt.NDArray[np.float64], rl2: npt.NDArray[np.float64], fft_size: int):
static PyObject *__pyx_pw_8pysndlib_3clm_135convolution(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_convolution(PyObject *__pyx_v_rl1, PyObject *__pyx_v_rl2, CYTHON_UNUSED PyObject *__pyx_v_fft_size, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_rl1_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_rl2_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolution", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rl1_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rl2_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_135convolution(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_134convolution, "\n    convolution of ndarrays v1 with v2, using fft of size len (a power of 2), result in v1.\n\n    :param rl1: input data 1\n    :param rl2: input  data 2\n    :param fft_size: fft size\n    :return: convolved output. also written into rl1\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_135convolution = {"convolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_135convolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_134convolution};
static PyObject *__pyx_pw_8pysndlib_3clm_135convolution(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rl1 = 0;
  PyObject *__pyx_v_rl2 = 0;
  PyObject *__pyx_v_fft_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolution (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rl1,&__pyx_n_s_rl2,&__pyx_n_s_fft_size,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rl1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rl2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("convolution", 1, 3, 3, 1); __PYX_ERR(0, 1491, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fft_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("convolution", 1, 3, 3, 2); __PYX_ERR(0, 1491, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convolution") < 0)) __PYX_ERR(0, 1491, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_rl1 = values[0];
    __pyx_v_rl2 = values[1];
    __pyx_v_fft_size = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convolution", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1491, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fft_size), (&PyInt_Type), 0, "fft_size", 1))) __PYX_ERR(0, 1491, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_134convolution(__pyx_self, __pyx_v_rl1, __pyx_v_rl2, __pyx_v_fft_size);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_134convolution(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rl1, PyObject *__pyx_v_rl2, PyObject *__pyx_v_fft_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolution", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_convolution(__pyx_v_rl1, __pyx_v_rl2, __pyx_v_fft_size, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__223 = PyTuple_Pack(3, __pyx_n_s_rl1, __pyx_n_s_rl2, __pyx_n_s_fft_size); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_rl1, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_rl2, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fft_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 1491, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_135convolution, 0, __pyx_n_s_convolution, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolution, __pyx_t_40) < 0) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_convolution, 1491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 1491, __pyx_L1_error)
 1492:     """
 1493:     convolution of ndarrays v1 with v2, using fft of size len (a power of 2), result in v1.
 1494: 
 1495:     :param rl1: input data 1
 1496:     :param rl2: input  data 2
 1497:     :param fft_size: fft size
 1498:     :return: convolved output. also written into rl1
 1499:     :rtype: np.ndarray
 1500:     
 1501:     """
+1502:     size = len(rl1)
  __pyx_t_1 = PyObject_Length(__pyx_v_rl1); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1502, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
+1503:     cdef double [:] rl1_view = rl1
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rl1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __pyx_v_rl1_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+1504:     cdef double [:] rl2_view = rl2
  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_rl2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1504, __pyx_L1_error)
  __pyx_v_rl2_view = __pyx_t_2;
  __pyx_t_2.memview = NULL;
  __pyx_t_2.data = NULL;
+1505:     check_ndim(rl1)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rl1};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+1506:     check_ndim(rl2)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rl2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+1507:     compare_shapes(rl1, rl2)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_rl1, __pyx_v_rl2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 1508: 
+1509:     cclm.mus_convolution(&rl1_view[0], &rl2_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_rl1_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_rl1_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1509, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_rl2_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_rl2_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 1509, __pyx_L1_error)
  }
  (void)(mus_convolution((&(*((double *) ( /* dim=0 */ (__pyx_v_rl1_view.data + __pyx_t_7 * __pyx_v_rl1_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_rl2_view.data + __pyx_t_8 * __pyx_v_rl2_view.strides[0]) )))), __pyx_v_size));
+1510:     return rl1
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_rl1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rl1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_rl1);
  __pyx_r = ((PyArrayObject *)__pyx_v_rl1);
  goto __pyx_L0;
 1511: 
+1512: cpdef np.ndarray autocorrelate(data: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_137autocorrelate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_autocorrelate(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_data_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("autocorrelate", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_AddTraceback("pysndlib.clm.autocorrelate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_137autocorrelate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_136autocorrelate, "\n    in place autocorrelation of data (a ndarray).\n\n    :param data: data\n    :return: autocorrelation result\n    :rtype: np.ndarray\n\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_137autocorrelate = {"autocorrelate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_137autocorrelate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_136autocorrelate};
static PyObject *__pyx_pw_8pysndlib_3clm_137autocorrelate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("autocorrelate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1512, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "autocorrelate") < 0)) __PYX_ERR(0, 1512, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_data = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("autocorrelate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1512, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.autocorrelate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_136autocorrelate(__pyx_self, __pyx_v_data);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_136autocorrelate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("autocorrelate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_autocorrelate(__pyx_v_data, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.autocorrelate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__225 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_data, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1512, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_137autocorrelate, 0, __pyx_n_s_autocorrelate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autocorrelate, __pyx_t_37) < 0) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_autocorrelate, 1512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 1512, __pyx_L1_error)
 1513:     """
 1514:     in place autocorrelation of data (a ndarray).
 1515: 
 1516:     :param data: data
 1517:     :return: autocorrelation result
 1518:     :rtype: np.ndarray
 1519: 
 1520:     """
+1521:     size = len(data)
  __pyx_t_1 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1521, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
+1522:     check_ndim(data)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 1523: 
+1524:     cdef double [:] data_view = data
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __pyx_v_data_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
+1525:     cclm.mus_autocorrelate(&data_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_data_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_data_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 1525, __pyx_L1_error)
  }
  (void)(mus_autocorrelate((&(*((double *) ( /* dim=0 */ (__pyx_v_data_view.data + __pyx_t_7 * __pyx_v_data_view.strides[0]) )))), __pyx_v_size));
+1526:     return data
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_data, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1526, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_data);
  __pyx_r = ((PyArrayObject *)__pyx_v_data);
  goto __pyx_L0;
 1527: 
+1528: cpdef np.ndarray correlate(data1: npt.NDArray[np.float64], data2: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_139correlate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_correlate(PyObject *__pyx_v_data1, PyObject *__pyx_v_data2, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_data1_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_data2_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("correlate", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_AddTraceback("pysndlib.clm.correlate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data1_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data2_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_139correlate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_138correlate, "\n    in place cross-correlation of data1 and data2 (both ndarrays).\n    \n    :param data1: data 1\n    :param data2: data 2\n    :return: correlation result written into data1\n    :rtype: np.ndarray\n    \n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_139correlate = {"correlate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_139correlate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_138correlate};
static PyObject *__pyx_pw_8pysndlib_3clm_139correlate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data1 = 0;
  PyObject *__pyx_v_data2 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("correlate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data1,&__pyx_n_s_data2,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1528, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1528, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("correlate", 1, 2, 2, 1); __PYX_ERR(0, 1528, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "correlate") < 0)) __PYX_ERR(0, 1528, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_data1 = values[0];
    __pyx_v_data2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("correlate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1528, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.correlate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_138correlate(__pyx_self, __pyx_v_data1, __pyx_v_data2);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_138correlate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data1, PyObject *__pyx_v_data2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("correlate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_correlate(__pyx_v_data1, __pyx_v_data2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.correlate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_data1, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_data2, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1528, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_139correlate, 0, __pyx_n_s_correlate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_correlate, __pyx_t_40) < 0) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_correlate, 1528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1528, __pyx_L1_error)
 1529:     """
 1530:     in place cross-correlation of data1 and data2 (both ndarrays).
 1531:     
 1532:     :param data1: data 1
 1533:     :param data2: data 2
 1534:     :return: correlation result written into data1
 1535:     :rtype: np.ndarray
 1536:     
 1537:     
 1538:     """
 1539: 
+1540:     size = len(data1)
  __pyx_t_1 = PyObject_Length(__pyx_v_data1); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1540, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
+1541:     check_ndim(data1)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1542:     check_ndim(data2)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data2};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1543:     compare_shapes(data1, data2)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_data1, __pyx_v_data2};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1544:     cdef double [:] data1_view = data1
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __pyx_v_data1_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
+1545:     cdef double [:] data2_view = data2
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __pyx_v_data2_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
 1546: 
+1547:     cclm.mus_correlate(&data1_view[0], &data2_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_data1_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_data1_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 1547, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_data2_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_data2_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 1547, __pyx_L1_error)
  }
  (void)(mus_correlate((&(*((double *) ( /* dim=0 */ (__pyx_v_data1_view.data + __pyx_t_7 * __pyx_v_data1_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_data2_view.data + __pyx_t_8 * __pyx_v_data2_view.strides[0]) )))), __pyx_v_size));
+1548:     return data1
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_data1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_data1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_data1);
  __pyx_r = ((PyArrayObject *)__pyx_v_data1);
  goto __pyx_L0;
 1549: 
+1550: cpdef np.ndarray cepstrum(data: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_141cepstrum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_cepstrum(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_size;
  __Pyx_memviewslice __pyx_v_data_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cepstrum", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_AddTraceback("pysndlib.clm.cepstrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data_view, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_141cepstrum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_140cepstrum, "\n    return cepstrum of signal\n    \n    :param data: samples to analyze\n    :return: cepstrum. also written into data\n    :rtype: np.ndarray\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_141cepstrum = {"cepstrum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_141cepstrum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_140cepstrum};
static PyObject *__pyx_pw_8pysndlib_3clm_141cepstrum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cepstrum (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cepstrum") < 0)) __PYX_ERR(0, 1550, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_data = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cepstrum", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1550, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.cepstrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_140cepstrum(__pyx_self, __pyx_v_data);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_140cepstrum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cepstrum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_cepstrum(__pyx_v_data, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.cepstrum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_data, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1550, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_141cepstrum, 0, __pyx_n_s_cepstrum, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cepstrum, __pyx_t_37) < 0) __PYX_ERR(0, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_cepstrum, 1550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 1550, __pyx_L1_error)
 1551:     """
 1552:     return cepstrum of signal
 1553:     
 1554:     :param data: samples to analyze
 1555:     :return: cepstrum. also written into data
 1556:     :rtype: np.ndarray
 1557:     """
+1558:     size = len(data)
  __pyx_t_1 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1558, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;
+1559:     check_ndim(data)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1560:     cdef double [:] data_view = data
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __pyx_v_data_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
+1561:     cclm.mus_cepstrum(&data_view[0], size)
  __pyx_t_7 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_data_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_data_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 1561, __pyx_L1_error)
  }
  (void)(mus_cepstrum((&(*((double *) ( /* dim=0 */ (__pyx_v_data_view.data + __pyx_t_7 * __pyx_v_data_view.strides[0]) )))), __pyx_v_size));
+1562:     return data
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_data, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_data);
  __pyx_r = ((PyArrayObject *)__pyx_v_data);
  goto __pyx_L0;
 1563: 
+1564: cpdef np.ndarray partials2wave(partials, wave: npt.NDArray[np.float64]=None, table_size: Optional[int]=None, norm: Optional[bool]=True ):
static PyObject *__pyx_pw_8pysndlib_3clm_143partials2wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_partials2wave(PyObject *__pyx_v_partials, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_partials2wave *__pyx_optional_args) {
  PyObject *__pyx_v_wave = ((PyObject *)Py_None);
  PyObject *__pyx_v_table_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_norm = ((PyObject *)Py_True);
  __Pyx_memviewslice __pyx_v_wave_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_partials_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partials2wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_wave = __pyx_optional_args->wave;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_table_size = __pyx_optional_args->table_size;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_norm = __pyx_optional_args->norm;
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_partials);
  __Pyx_INCREF(__pyx_v_wave);
  __Pyx_INCREF(__pyx_v_table_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("pysndlib.clm.partials2wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_wave_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_partials_view, 1);
  __Pyx_XDECREF(__pyx_v_partials);
  __Pyx_XDECREF(__pyx_v_wave);
  __Pyx_XDECREF(__pyx_v_table_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_143partials2wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_142partials2wave, "\n    take a list or np.ndarray of partials (harmonic number and associated amplitude) and produce a\n    waveform for use in table_lookup.\n    \n    :param partials: list or np.ndarray of partials (harm and amp)\n    :param wave: array to write wave into. if not provided, one will be allocated\n    :param table_size: size of table\n    :param norm: whether to normalize partials\n    :return: array provided in wave or new array.\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_143partials2wave = {"partials2wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_143partials2wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_142partials2wave};
static PyObject *__pyx_pw_8pysndlib_3clm_143partials2wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_partials = 0;
  PyObject *__pyx_v_wave = 0;
  PyObject *__pyx_v_table_size = 0;
  PyObject *__pyx_v_norm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partials2wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_partials,&__pyx_n_s_wave,&__pyx_n_s_table_size,&__pyx_n_s_norm,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_True);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partials)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wave);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table_size);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "partials2wave") < 0)) __PYX_ERR(0, 1564, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_partials = values[0];
    __pyx_v_wave = values[1];
    __pyx_v_table_size = values[2];
    __pyx_v_norm = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("partials2wave", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1564, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.partials2wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_142partials2wave(__pyx_self, __pyx_v_partials, __pyx_v_wave, __pyx_v_table_size, __pyx_v_norm);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_142partials2wave(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_partials, PyObject *__pyx_v_wave, PyObject *__pyx_v_table_size, PyObject *__pyx_v_norm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partials2wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.wave = __pyx_v_wave;
  __pyx_t_2.table_size = __pyx_v_table_size;
  __pyx_t_2.norm = __pyx_v_norm;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_partials2wave(__pyx_v_partials, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.partials2wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__229 = PyTuple_Pack(4, __pyx_n_s_partials, __pyx_n_s_wave, __pyx_n_s_table_size, __pyx_n_s_norm); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_partials2wave, 1564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 1564, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_wave, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_table_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_norm, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_143partials2wave, 0, __pyx_n_s_partials2wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__231);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partials2wave, __pyx_t_40) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__231 = PyTuple_Pack(3, Py_None, Py_None, Py_True); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_partials2wave {
  int __pyx_n;
  PyObject *wave;
  PyObject *table_size;
  PyObject *norm;
};
 1565:     """
 1566:     take a list or np.ndarray of partials (harmonic number and associated amplitude) and produce a
 1567:     waveform for use in table_lookup.
 1568:     
 1569:     :param partials: list or np.ndarray of partials (harm and amp)
 1570:     :param wave: array to write wave into. if not provided, one will be allocated
 1571:     :param table_size: size of table
 1572:     :param norm: whether to normalize partials
 1573:     :return: array provided in wave or new array.
 1574:     :rtype: np.ndarray
 1575:     
 1576:     """
 1577: 
+1578:     if isinstance(partials, list):
  __pyx_t_1 = PyList_Check(__pyx_v_partials); 
  if (__pyx_t_1) {
/* … */
  }
+1579:         partials = np.array(partials, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_partials);
    __Pyx_GIVEREF(__pyx_v_partials);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_partials);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_partials, __pyx_t_6);
    __pyx_t_6 = 0;
 1580: 
+1581:     if isinstance(wave, list):
  __pyx_t_1 = PyList_Check(__pyx_v_wave); 
  if (__pyx_t_1) {
/* … */
  }
+1582:         wave = np.array(wave, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_wave);
    __Pyx_GIVEREF(__pyx_v_wave);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_wave);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_5);
    __pyx_t_5 = 0;
 1583: 
+1584:     if not wave:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_wave); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_1);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L5;
  }
+1585:         if table_size is not None:
    __pyx_t_7 = (__pyx_v_table_size != Py_None);
    if (__pyx_t_7) {
/* … */
      goto __pyx_L6;
    }
+1586:             wave = np.zeros(table_size)
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_table_size};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_5);
      __pyx_t_5 = 0;
 1587:         else:
+1588:             table_size = CLM.table_size
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_table_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_table_size, __pyx_t_6);
      __pyx_t_6 = 0;
+1589:             wave = np.zeros(CLM.table_size)
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_table_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_8 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_6);
      __pyx_t_6 = 0;
    }
    __pyx_L6:;
 1590:     else:
+1591:         table_size = len(wave)
  /*else*/ {
    __pyx_t_9 = PyObject_Length(__pyx_v_wave); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1591, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_table_size, __pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L5:;
 1592: 
+1593:     check_ndim(partials)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_partials};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1594:     check_ndim(wave)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_wave};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1595: 
+1596:     cdef double [:] wave_view = wave
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_wave, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1596, __pyx_L1_error)
  __pyx_v_wave_view = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;
+1597:     cdef double [:] partials_view = partials
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_partials, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __pyx_v_partials_view = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;
 1598: 
+1599:     cclm.mus_partials_to_wave(&partials_view[0], len(partials) // 2, &wave_view[0], table_size, norm)
  __pyx_t_11 = 0;
  __pyx_t_8 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_partials_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_partials_view.shape[0])) __pyx_t_8 = 0;
  if (unlikely(__pyx_t_8 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_8);
    __PYX_ERR(0, 1599, __pyx_L1_error)
  }
  __pyx_t_9 = PyObject_Length(__pyx_v_partials); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1599, __pyx_L1_error)
  __pyx_t_12 = 0;
  __pyx_t_8 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_wave_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_wave_view.shape[0])) __pyx_t_8 = 0;
  if (unlikely(__pyx_t_8 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_8);
    __PYX_ERR(0, 1599, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_PyInt_As_mus_long_t(__pyx_v_table_size); if (unlikely((__pyx_t_13 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1599, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_norm); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1599, __pyx_L1_error)
  (void)(mus_partials_to_wave((&(*((double *) ( /* dim=0 */ (__pyx_v_partials_view.data + __pyx_t_11 * __pyx_v_partials_view.strides[0]) )))), __Pyx_div_Py_ssize_t(__pyx_t_9, 2), (&(*((double *) ( /* dim=0 */ (__pyx_v_wave_view.data + __pyx_t_12 * __pyx_v_wave_view.strides[0]) )))), __pyx_t_13, __pyx_t_7));
+1600:     return wave
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_wave) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_wave, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_wave);
  __pyx_r = ((PyArrayObject *)__pyx_v_wave);
  goto __pyx_L0;
 1601: 
+1602: cpdef np.ndarray phase_partials2wave(partials, wave: npt.NDArray[np.float64], table_size: Optional[int]=None, norm: Optional[bool]=True ):
static PyObject *__pyx_pw_8pysndlib_3clm_145phase_partials2wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_phase_partials2wave(PyObject *__pyx_v_partials, PyObject *__pyx_v_wave, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_phase_partials2wave *__pyx_optional_args) {
  PyObject *__pyx_v_table_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_norm = ((PyObject *)Py_True);
  __Pyx_memviewslice __pyx_v_wave_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_partials_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_partials2wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_table_size = __pyx_optional_args->table_size;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_norm = __pyx_optional_args->norm;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_partials);
  __Pyx_INCREF(__pyx_v_wave);
  __Pyx_INCREF(__pyx_v_table_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("pysndlib.clm.phase_partials2wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_wave_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_partials_view, 1);
  __Pyx_XDECREF(__pyx_v_partials);
  __Pyx_XDECREF(__pyx_v_wave);
  __Pyx_XDECREF(__pyx_v_table_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_145phase_partials2wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_144phase_partials2wave, "\n    take a list of partials (harmonic number, amplitude, initial phase) and produce a waveform for use\n    in table_lookup.\n    \n    :param partials: list or np.ndarray of partials (harm, amp, phase)\n    :param wave: array to write wave into. if not provided, one will be allocated\n    :param table_size: size of table\n    :param norm: whether to normalize partials\n    :return: array provided in wave or new array.\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_145phase_partials2wave = {"phase_partials2wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_145phase_partials2wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_144phase_partials2wave};
static PyObject *__pyx_pw_8pysndlib_3clm_145phase_partials2wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_partials = 0;
  PyObject *__pyx_v_wave = 0;
  PyObject *__pyx_v_table_size = 0;
  PyObject *__pyx_v_norm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_partials2wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_partials,&__pyx_n_s_wave,&__pyx_n_s_table_size,&__pyx_n_s_norm,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_True);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partials)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wave)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("phase_partials2wave", 0, 2, 4, 1); __PYX_ERR(0, 1602, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table_size);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_norm);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_partials2wave") < 0)) __PYX_ERR(0, 1602, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_partials = values[0];
    __pyx_v_wave = values[1];
    __pyx_v_table_size = values[2];
    __pyx_v_norm = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_partials2wave", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1602, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_partials2wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_144phase_partials2wave(__pyx_self, __pyx_v_partials, __pyx_v_wave, __pyx_v_table_size, __pyx_v_norm);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_144phase_partials2wave(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_partials, PyObject *__pyx_v_wave, PyObject *__pyx_v_table_size, PyObject *__pyx_v_norm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_partials2wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.table_size = __pyx_v_table_size;
  __pyx_t_2.norm = __pyx_v_norm;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_phase_partials2wave(__pyx_v_partials, __pyx_v_wave, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.phase_partials2wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_partials2wave, 1602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 1602, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_wave, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_table_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_norm, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_145phase_partials2wave, 0, __pyx_n_s_phase_partials2wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__233);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_partials2wave, __pyx_t_37) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__233 = PyTuple_Pack(2, Py_None, Py_True); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_phase_partials2wave {
  int __pyx_n;
  PyObject *table_size;
  PyObject *norm;
};
 1603:     """
 1604:     take a list of partials (harmonic number, amplitude, initial phase) and produce a waveform for use
 1605:     in table_lookup.
 1606:     
 1607:     :param partials: list or np.ndarray of partials (harm, amp, phase)
 1608:     :param wave: array to write wave into. if not provided, one will be allocated
 1609:     :param table_size: size of table
 1610:     :param norm: whether to normalize partials
 1611:     :return: array provided in wave or new array.
 1612:     :rtype: np.ndarray
 1613:     
 1614:     """
 1615: 
+1616:     if isinstance(partials, list):
  __pyx_t_1 = PyList_Check(__pyx_v_partials); 
  if (__pyx_t_1) {
/* … */
  }
+1617:         partials = np.array(partials, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_partials);
    __Pyx_GIVEREF(__pyx_v_partials);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_partials);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_partials, __pyx_t_6);
    __pyx_t_6 = 0;
 1618: 
+1619:     if (not wave):
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_wave); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1619, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_1);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L4;
  }
+1620:         if table_size:
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_table_size); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1620, __pyx_L1_error)
    if (__pyx_t_7) {
/* … */
      goto __pyx_L5;
    }
+1621:             wave = np.zeros(table_size)
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_8 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_table_size};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_6);
      __pyx_t_6 = 0;
 1622:         else:
+1623:             wave = np.zeros(CLM.table_size)
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_table_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_8 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_6);
      __pyx_t_6 = 0;
    }
    __pyx_L5:;
 1624:     else:
+1625:         table_size = len(wave)
  /*else*/ {
    __pyx_t_9 = PyObject_Length(__pyx_v_wave); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1625, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_table_size, __pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L4:;
 1626: 
+1627:     check_ndim(wave)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_wave};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1628:     check_ndim(partials)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_partials};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1629: 
+1630:     cdef double [:] wave_view = wave
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_wave, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __pyx_v_wave_view = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;
+1631:     cdef double [:] partials_view = partials
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_partials, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1631, __pyx_L1_error)
  __pyx_v_partials_view = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;
 1632: 
+1633:     cclm.mus_partials_to_wave(&partials_view[0], len(partials) // 3, &wave_view[0], table_size, norm)
  __pyx_t_11 = 0;
  __pyx_t_8 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_partials_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_partials_view.shape[0])) __pyx_t_8 = 0;
  if (unlikely(__pyx_t_8 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_8);
    __PYX_ERR(0, 1633, __pyx_L1_error)
  }
  __pyx_t_9 = PyObject_Length(__pyx_v_partials); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1633, __pyx_L1_error)
  __pyx_t_12 = 0;
  __pyx_t_8 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_wave_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_wave_view.shape[0])) __pyx_t_8 = 0;
  if (unlikely(__pyx_t_8 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_8);
    __PYX_ERR(0, 1633, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_PyInt_As_mus_long_t(__pyx_v_table_size); if (unlikely((__pyx_t_13 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1633, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_norm); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1633, __pyx_L1_error)
  (void)(mus_partials_to_wave((&(*((double *) ( /* dim=0 */ (__pyx_v_partials_view.data + __pyx_t_11 * __pyx_v_partials_view.strides[0]) )))), __Pyx_div_Py_ssize_t(__pyx_t_9, 3), (&(*((double *) ( /* dim=0 */ (__pyx_v_wave_view.data + __pyx_t_12 * __pyx_v_wave_view.strides[0]) )))), __pyx_t_13, __pyx_t_7));
+1634:     return wave
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_wave) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_wave, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_wave);
  __pyx_r = ((PyArrayObject *)__pyx_v_wave);
  goto __pyx_L0;
 1635: 
+1636: cpdef np.ndarray partials2polynomial(partials, kind: Optional[Polynomial]=Polynomial.FIRST_KIND):
static PyObject *__pyx_pw_8pysndlib_3clm_147partials2polynomial(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_partials2polynomial(PyObject *__pyx_v_partials, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_partials2polynomial *__pyx_optional_args) {
  PyObject *__pyx_v_kind = __pyx_k__26;
  PyArrayObject *__pyx_v_p = NULL;
  __Pyx_memviewslice __pyx_v_p_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partials2polynomial", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_kind = __pyx_optional_args->kind;
    }
  }
  __Pyx_INCREF(__pyx_v_partials);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.partials2polynomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_p_view, 1);
  __Pyx_XDECREF(__pyx_v_partials);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_147partials2polynomial(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_146partials2polynomial, "\n    returns a chebyshev polynomial suitable for use with the polynomial generator to create (via\n    waveshaping) the harmonic spectrum described by the partials argument.\n    \n    :param partials: list or np.ndarray of partials (harm and amp)\n    :param kind: Polynomial.EITHER_KIND, Polynomial.FIRST_KIND, Polynomial.SECOND_KIND, Polynomial.BOTH_KINDS\n    :return: chebyshev polynomial\n    :rtype: np.ndarray\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_147partials2polynomial = {"partials2polynomial", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_147partials2polynomial, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_146partials2polynomial};
static PyObject *__pyx_pw_8pysndlib_3clm_147partials2polynomial(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_partials = 0;
  PyObject *__pyx_v_kind = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partials2polynomial (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_partials,&__pyx_n_s_kind,0};
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k__26;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partials)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kind);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "partials2polynomial") < 0)) __PYX_ERR(0, 1636, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_partials = values[0];
    __pyx_v_kind = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("partials2polynomial", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1636, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.partials2polynomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_146partials2polynomial(__pyx_self, __pyx_v_partials, __pyx_v_kind);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_146partials2polynomial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_partials, PyObject *__pyx_v_kind) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partials2polynomial", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.kind = __pyx_v_kind;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_partials2polynomial(__pyx_v_partials, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.partials2polynomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_Enum_Polynomial_to_py(__pyx_e_8pysndlib_3clm_FIRST_KIND); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_k__26 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __pyx_tuple__234 = PyTuple_Pack(2, __pyx_n_s_partials, __pyx_n_s_kind); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);
  __pyx_t_37 = __Pyx_Enum_Polynomial_to_py(__pyx_e_8pysndlib_3clm_FIRST_KIND); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = PyTuple_New(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_37);
  __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_kind, __pyx_kp_s_Optional_Polynomial) < 0) __PYX_ERR(0, 1636, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_147partials2polynomial, 0, __pyx_n_s_partials2polynomial, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partials2polynomial, __pyx_t_41) < 0) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_partials2polynomial, 1636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 1636, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_partials2polynomial {
  int __pyx_n;
  PyObject *kind;
};
 1637:     """
 1638:     returns a chebyshev polynomial suitable for use with the polynomial generator to create (via
 1639:     waveshaping) the harmonic spectrum described by the partials argument.
 1640:     
 1641:     :param partials: list or np.ndarray of partials (harm and amp)
 1642:     :param kind: Polynomial.EITHER_KIND, Polynomial.FIRST_KIND, Polynomial.SECOND_KIND, Polynomial.BOTH_KINDS
 1643:     :return: chebyshev polynomial
 1644:     :rtype: np.ndarray
 1645:     
 1646:     """
+1647:     if isinstance(partials, list):
  __pyx_t_1 = PyList_Check(__pyx_v_partials); 
  if (__pyx_t_1) {
/* … */
  }
+1648:         partials = np.array(partials, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_partials);
    __Pyx_GIVEREF(__pyx_v_partials);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_partials);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_partials, __pyx_t_6);
    __pyx_t_6 = 0;
 1649: 
+1650:     check_ndim(partials)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_partials};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1651: 
+1652:     p = to_partials(partials)
  __pyx_t_6 = ((PyObject *)__pyx_f_8pysndlib_3clm_to_partials(__pyx_v_partials, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_p = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;
 1653: 
+1654:     cdef double [:] p_view = p
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_p), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1654, __pyx_L1_error)
  __pyx_v_p_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 1655: 
+1656:     cclm.mus_partials_to_polynomial(len(p), &p_view[0], kind)
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1656, __pyx_L1_error)
  __pyx_t_10 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_v_p_view.shape[0];
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_v_p_view.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(0, 1656, __pyx_L1_error)
  }
  __pyx_t_11 = ((mus_polynomial_t)__Pyx_PyInt_As_mus_polynomial_t(__pyx_v_kind)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1656, __pyx_L1_error)
  (void)(mus_partials_to_polynomial(__pyx_t_9, (&(*((double *) ( /* dim=0 */ (__pyx_v_p_view.data + __pyx_t_10 * __pyx_v_p_view.strides[0]) )))), __pyx_t_11));
+1657:     return p
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_p);
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;
 1658: 
+1659: cpdef np.ndarray normalize_partials(partials):
static PyObject *__pyx_pw_8pysndlib_3clm_149normalize_partials(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_normalize_partials(PyObject *__pyx_v_partials, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_partials_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("normalize_partials", 0);
  __Pyx_INCREF(__pyx_v_partials);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.normalize_partials", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_partials_view, 1);
  __Pyx_XDECREF(__pyx_v_partials);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_149normalize_partials(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_148normalize_partials, "\n    scales the partial amplitudes in the list/array or list 'partials' by the inverse of their sum (so\n    that they add to 1.0).\n\n    :param partials: list or np.ndarray of partials (harm and amp)\n    :return: normalized partials\n    :rtype: np.ndarray      \n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_149normalize_partials = {"normalize_partials", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_149normalize_partials, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_148normalize_partials};
static PyObject *__pyx_pw_8pysndlib_3clm_149normalize_partials(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_partials = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("normalize_partials (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_partials,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partials)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1659, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "normalize_partials") < 0)) __PYX_ERR(0, 1659, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_partials = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("normalize_partials", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1659, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.normalize_partials", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_148normalize_partials(__pyx_self, __pyx_v_partials);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_148normalize_partials(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_partials) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("normalize_partials", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_normalize_partials(__pyx_v_partials, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.normalize_partials", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__236 = PyTuple_Pack(1, __pyx_n_s_partials); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);
/* … */
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_149normalize_partials, 0, __pyx_n_s_normalize_partials, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_partials, __pyx_t_41) < 0) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_normalize_partials, 1659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 1659, __pyx_L1_error)
 1660:     """
 1661:     scales the partial amplitudes in the list/array or list 'partials' by the inverse of their sum (so
 1662:     that they add to 1.0).
 1663: 
 1664:     :param partials: list or np.ndarray of partials (harm and amp)
 1665:     :return: normalized partials
 1666:     :rtype: np.ndarray      
 1667:     
 1668:     """
+1669:     if isinstance(partials, list):
  __pyx_t_1 = PyList_Check(__pyx_v_partials); 
  if (__pyx_t_1) {
/* … */
  }
+1670:         partials = np.array(partials, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_partials);
    __Pyx_GIVEREF(__pyx_v_partials);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_partials);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_partials, __pyx_t_6);
    __pyx_t_6 = 0;
 1671: 
+1672:     check_ndim(partials)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_partials};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1673: 
+1674:     cdef double [:] partials_view = partials
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_partials, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __pyx_v_partials_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 1675: 
+1676:     cclm.mus_normalize_partials(len(partials), &partials_view[0])
  __pyx_t_9 = PyObject_Length(__pyx_v_partials); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1676, __pyx_L1_error)
  __pyx_t_10 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_v_partials_view.shape[0];
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_v_partials_view.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(0, 1676, __pyx_L1_error)
  }
  (void)(mus_normalize_partials(__pyx_t_9, (&(*((double *) ( /* dim=0 */ (__pyx_v_partials_view.data + __pyx_t_10 * __pyx_v_partials_view.strides[0]) ))))));
 1677: 
+1678:     return partials
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_partials) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_partials, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_partials);
  __pyx_r = ((PyArrayObject *)__pyx_v_partials);
  goto __pyx_L0;
 1679: 
+1680: cpdef cython.double chebyshev_tu_sum(x: cython.double, tcoeffs: npt.NDArray[np.float64], ucoeffs: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_151chebyshev_tu_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_chebyshev_tu_sum(double __pyx_v_x, PyObject *__pyx_v_tcoeffs, PyObject *__pyx_v_ucoeffs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_tcoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_ucoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_tu_sum", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_tu_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_tcoeffs_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ucoeffs_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_151chebyshev_tu_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_150chebyshev_tu_sum, "\n    returns the sum of the weighted chebyshev polynomials tn and un, with phase x\n    \n    :param x: input\n    :param tcoeffs: tn\n    :param ucoeffs: un\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_151chebyshev_tu_sum = {"chebyshev_tu_sum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_151chebyshev_tu_sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_150chebyshev_tu_sum};
static PyObject *__pyx_pw_8pysndlib_3clm_151chebyshev_tu_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  PyObject *__pyx_v_tcoeffs = 0;
  PyObject *__pyx_v_ucoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_tu_sum (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_tcoeffs,&__pyx_n_s_ucoeffs,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tcoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("chebyshev_tu_sum", 1, 3, 3, 1); __PYX_ERR(0, 1680, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ucoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("chebyshev_tu_sum", 1, 3, 3, 2); __PYX_ERR(0, 1680, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chebyshev_tu_sum") < 0)) __PYX_ERR(0, 1680, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L3_error)
    __pyx_v_tcoeffs = values[1];
    __pyx_v_ucoeffs = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chebyshev_tu_sum", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1680, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_tu_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_150chebyshev_tu_sum(__pyx_self, __pyx_v_x, __pyx_v_tcoeffs, __pyx_v_ucoeffs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_150chebyshev_tu_sum(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, PyObject *__pyx_v_tcoeffs, PyObject *__pyx_v_ucoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_tu_sum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_chebyshev_tu_sum(__pyx_v_x, __pyx_v_tcoeffs, __pyx_v_ucoeffs, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_tu_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__238 = PyTuple_Pack(3, __pyx_n_s_x, __pyx_n_s_tcoeffs, __pyx_n_s_ucoeffs); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 1680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1680, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_tcoeffs, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1680, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_ucoeffs, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1680, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_151chebyshev_tu_sum, 0, __pyx_n_s_chebyshev_tu_sum, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chebyshev_tu_sum, __pyx_t_37) < 0) __PYX_ERR(0, 1680, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_chebyshev_tu_sum, 1680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 1680, __pyx_L1_error)
 1681:     """
 1682:     returns the sum of the weighted chebyshev polynomials tn and un, with phase x
 1683:     
 1684:     :param x: input
 1685:     :param tcoeffs: tn
 1686:     :param ucoeffs: un
 1687:     :rtype: float
 1688:     
 1689:     """
 1690: 
+1691:     check_ndim(tcoeffs)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_tcoeffs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1692:     check_ndim(ucoeffs)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_ucoeffs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1693:     compare_shapes(tcoeffs, ucoeffs)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_tcoeffs, __pyx_v_ucoeffs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1694: 
+1695:     cdef double [:] tcoeffs_view = tcoeffs
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_tcoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1695, __pyx_L1_error)
  __pyx_v_tcoeffs_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1696:     cdef double [:] ucoeffs_view = ucoeffs
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_ucoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1696, __pyx_L1_error)
  __pyx_v_ucoeffs_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1697:     return cclm.mus_chebyshev_tu_sum(x, len(tcoeffs), &tcoeffs_view[0], &ucoeffs_view[0])
  __pyx_t_6 = PyObject_Length(__pyx_v_tcoeffs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1697, __pyx_L1_error)
  __pyx_t_7 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_tcoeffs_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_tcoeffs_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1697, __pyx_L1_error)
  }
  __pyx_t_8 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_ucoeffs_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_ucoeffs_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1697, __pyx_L1_error)
  }
  __pyx_r = mus_chebyshev_tu_sum(__pyx_v_x, __pyx_t_6, (&(*((double *) ( /* dim=0 */ (__pyx_v_tcoeffs_view.data + __pyx_t_7 * __pyx_v_tcoeffs_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_ucoeffs_view.data + __pyx_t_8 * __pyx_v_ucoeffs_view.strides[0]) )))));
  goto __pyx_L0;
 1698: 
 1699: 
+1700: cpdef cython.double chebyshev_t_sum(x: cython.double, tcoeffs: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_153chebyshev_t_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_chebyshev_t_sum(double __pyx_v_x, PyObject *__pyx_v_tcoeffs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_tcoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_t_sum", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_t_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_tcoeffs_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_153chebyshev_t_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_152chebyshev_t_sum, "\n    returns the sum of the weighted chebyshev polynomials tn\n    \n    :param x: nput\n    :param tcoeffs: tn\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_153chebyshev_t_sum = {"chebyshev_t_sum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_153chebyshev_t_sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_152chebyshev_t_sum};
static PyObject *__pyx_pw_8pysndlib_3clm_153chebyshev_t_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  PyObject *__pyx_v_tcoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_t_sum (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_tcoeffs,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tcoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("chebyshev_t_sum", 1, 2, 2, 1); __PYX_ERR(0, 1700, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chebyshev_t_sum") < 0)) __PYX_ERR(0, 1700, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L3_error)
    __pyx_v_tcoeffs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chebyshev_t_sum", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1700, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_t_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_152chebyshev_t_sum(__pyx_self, __pyx_v_x, __pyx_v_tcoeffs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_152chebyshev_t_sum(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, PyObject *__pyx_v_tcoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_t_sum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_chebyshev_t_sum(__pyx_v_x, __pyx_v_tcoeffs, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_t_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__240 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_tcoeffs); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1700, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_tcoeffs, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1700, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_153chebyshev_t_sum, 0, __pyx_n_s_chebyshev_t_sum, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chebyshev_t_sum, __pyx_t_41) < 0) __PYX_ERR(0, 1700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_chebyshev_t_sum, 1700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 1700, __pyx_L1_error)
 1701:     """
 1702:     returns the sum of the weighted chebyshev polynomials tn
 1703:     
 1704:     :param x: nput
 1705:     :param tcoeffs: tn
 1706:     :rtype: float
 1707:     
 1708:     """
 1709: 
+1710:     check_ndim(tcoeffs)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_tcoeffs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1711: 
+1712:     cdef double [:] tcoeffs_view = tcoeffs
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_tcoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __pyx_v_tcoeffs_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1713:     return cclm.mus_chebyshev_t_sum(x,len(tcoeffs), &tcoeffs_view[0])
  __pyx_t_6 = PyObject_Length(__pyx_v_tcoeffs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1713, __pyx_L1_error)
  __pyx_t_7 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_tcoeffs_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_tcoeffs_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1713, __pyx_L1_error)
  }
  __pyx_r = mus_chebyshev_t_sum(__pyx_v_x, __pyx_t_6, (&(*((double *) ( /* dim=0 */ (__pyx_v_tcoeffs_view.data + __pyx_t_7 * __pyx_v_tcoeffs_view.strides[0]) )))));
  goto __pyx_L0;
 1714: 
+1715: cpdef cython.double chebyshev_u_sum(x: cython.double, ucoeffs: npt.NDArray[np.float64]):
static PyObject *__pyx_pw_8pysndlib_3clm_155chebyshev_u_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_chebyshev_u_sum(double __pyx_v_x, PyObject *__pyx_v_ucoeffs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_ucoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_u_sum", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_u_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ucoeffs_view, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_155chebyshev_u_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_154chebyshev_u_sum, "\n    returns the sum of the weighted chebyshev polynomials un\n    \n    :param x: input\n    :param ucoeffs: un\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_155chebyshev_u_sum = {"chebyshev_u_sum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_155chebyshev_u_sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_154chebyshev_u_sum};
static PyObject *__pyx_pw_8pysndlib_3clm_155chebyshev_u_sum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  PyObject *__pyx_v_ucoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_u_sum (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_ucoeffs,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ucoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("chebyshev_u_sum", 1, 2, 2, 1); __PYX_ERR(0, 1715, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "chebyshev_u_sum") < 0)) __PYX_ERR(0, 1715, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L3_error)
    __pyx_v_ucoeffs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chebyshev_u_sum", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1715, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_u_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_154chebyshev_u_sum(__pyx_self, __pyx_v_x, __pyx_v_ucoeffs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_154chebyshev_u_sum(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, PyObject *__pyx_v_ucoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chebyshev_u_sum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_chebyshev_u_sum(__pyx_v_x, __pyx_v_ucoeffs, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.chebyshev_u_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__242 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_ucoeffs); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1715, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_ucoeffs, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 1715, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_155chebyshev_u_sum, 0, __pyx_n_s_chebyshev_u_sum, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chebyshev_u_sum, __pyx_t_37) < 0) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_chebyshev_u_sum, 1715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 1715, __pyx_L1_error)
 1716:     """
 1717:     returns the sum of the weighted chebyshev polynomials un
 1718:     
 1719:     :param x: input
 1720:     :param ucoeffs: un
 1721:     :rtype: float
 1722:     
 1723:     """
 1724: 
+1725:     check_ndim(ucoeffs)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_ucoeffs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1726: 
+1727:     cdef double [:] ucoeffs_view = ucoeffs
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_ucoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __pyx_v_ucoeffs_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
+1728:     return cclm.mus_chebyshev_u_sum(x,len(ucoeffs), &ucoeffs_view[0])
  __pyx_t_6 = PyObject_Length(__pyx_v_ucoeffs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1728, __pyx_L1_error)
  __pyx_t_7 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_v_ucoeffs_view.shape[0];
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_v_ucoeffs_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1728, __pyx_L1_error)
  }
  __pyx_r = mus_chebyshev_u_sum(__pyx_v_x, __pyx_t_6, (&(*((double *) ( /* dim=0 */ (__pyx_v_ucoeffs_view.data + __pyx_t_7 * __pyx_v_ucoeffs_view.strides[0]) )))));
  goto __pyx_L0;
 1729: 
 1730: 
 1731: 
 1732: 
 1733: # ---------------- oscil ---------------- #
+1734: cpdef mus_any make_oscil(frequency: Optional[float]=0., initial_phase: Optional[float] = 0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_157make_oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_oscil(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_oscil *__pyx_optional_args) {
  PyObject *__pyx_v_frequency = ((PyObject *)__pyx_float_0_);
  PyObject *__pyx_v_initial_phase = ((PyObject *)__pyx_float_0_0);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_oscil", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_frequency = __pyx_optional_args->frequency;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_phase = __pyx_optional_args->initial_phase;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.make_oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_157make_oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_156make_oscil, "\n    return a new oscil (sinewave) generator\n    \n    :param frequency: frequency in hz\n    :param initial_phase: initial phase in radians\n    :return: oscil gen\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_157make_oscil = {"make_oscil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_157make_oscil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_156make_oscil};
static PyObject *__pyx_pw_8pysndlib_3clm_157make_oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_frequency = 0;
  PyObject *__pyx_v_initial_phase = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_oscil (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_initial_phase,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_float_0_);
    values[1] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_phase);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_oscil") < 0)) __PYX_ERR(0, 1734, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = values[0];
    __pyx_v_initial_phase = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_oscil", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1734, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_156make_oscil(__pyx_self, __pyx_v_frequency, __pyx_v_initial_phase);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_156make_oscil(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_initial_phase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_oscil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.frequency = __pyx_v_frequency;
  __pyx_t_2.initial_phase = __pyx_v_initial_phase;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_oscil(0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__244 = PyTuple_Pack(2, __pyx_n_s_frequency, __pyx_n_s_initial_phase); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);
  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_oscil, 1734, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 1734, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1734, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_initial_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1734, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_157make_oscil, 0, __pyx_n_s_make_oscil, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__246);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_oscil, __pyx_t_41) < 0) __PYX_ERR(0, 1734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__246 = PyTuple_Pack(2, __pyx_float_0_, __pyx_float_0_0); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_oscil {
  int __pyx_n;
  PyObject *frequency;
  PyObject *initial_phase;
};
 1735:     """
 1736:     return a new oscil (sinewave) generator
 1737:     
 1738:     :param frequency: frequency in hz
 1739:     :param initial_phase: initial phase in radians
 1740:     :return: oscil gen
 1741:     """
+1742:     check_range('frequency', frequency, 0., get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1742, __pyx_L1_error)
  __pyx_t_4 = PyFloat_FromDouble((__pyx_t_3 / 2.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_frequency, __pyx_v_frequency, __pyx_float_0_, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1743: 
 1744: 
+1745:     return mus_any.from_ptr(cclm.mus_make_oscil(frequency, initial_phase))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_frequency); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L1_error)
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_initial_phase); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_oscil(__pyx_t_7, __pyx_t_8), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1746: 
+1747: cpdef cython.double oscil(gen: mus_any, fm: Optional[float]=None, pm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_159oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_oscil(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_oscil *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  PyObject *__pyx_v_pm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oscil", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_pm = __pyx_optional_args->pm;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_159oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_158oscil, "\n    return next sample from oscil gen: val = sin(phase + pm); phase += (freq + fm)\n    \n    :param gen: oscil gen\n    :param fm: fm input\n    :param pm: pm input\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_159oscil = {"oscil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_159oscil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_158oscil};
static PyObject *__pyx_pw_8pysndlib_3clm_159oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  PyObject *__pyx_v_pm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oscil (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,&__pyx_n_s_pm,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "oscil") < 0)) __PYX_ERR(0, 1747, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
    __pyx_v_pm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("oscil", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1747, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1747, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_158oscil(__pyx_self, __pyx_v_gen, __pyx_v_fm, __pyx_v_pm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_158oscil(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm, PyObject *__pyx_v_pm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oscil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_2.pm = __pyx_v_pm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_oscil(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__247 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_fm, __pyx_n_s_pm); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_oscil, 1747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 1747, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_pm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1747, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_159oscil, 0, __pyx_n_s_oscil, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__249);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_oscil, __pyx_t_37) < 0) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__249 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_oscil {
  int __pyx_n;
  PyObject *fm;
  PyObject *pm;
};
 1748:     """
 1749:     return next sample from oscil gen: val = sin(phase + pm); phase += (freq + fm)
 1750:     
 1751:     :param gen: oscil gen
 1752:     :param fm: fm input
 1753:     :param pm: pm input
 1754:     :rtype: float
 1755:     
 1756:     """
+1757:     if not (fm or pm):
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1757, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1757, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {
/* … */
  }
+1758:         return cclm.mus_oscil_unmodulated(gen._ptr)
    __pyx_r = mus_oscil_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
+1759:     elif fm and not pm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1759, __pyx_L1_error)
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1759, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_1);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {
/* … */
  }
+1760:         return cclm.mus_oscil_fm(gen._ptr, fm)
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_4 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1760, __pyx_L1_error)
    __pyx_r = mus_oscil_fm(__pyx_v_gen->_ptr, __pyx_t_4);
    goto __pyx_L0;
 1761:     else:
+1762:         return cclm.mus_oscil(gen._ptr, fm, pm)
  /*else*/ {
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_4 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L1_error)
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_pm); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L1_error)
    __pyx_r = mus_oscil(__pyx_v_gen->_ptr, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
  }
 1763: 
+1764: cpdef bint is_oscil(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_161is_oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_oscil(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_oscil", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_161is_oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_160is_oscil, "\n    returns True if gen is an oscil\n    \n    :param gen: oscil gen\n    :rtype: bool\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_161is_oscil = {"is_oscil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_161is_oscil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_160is_oscil};
static PyObject *__pyx_pw_8pysndlib_3clm_161is_oscil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_oscil (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_oscil") < 0)) __PYX_ERR(0, 1764, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_oscil", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1764, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1764, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_160is_oscil(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_160is_oscil(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_oscil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_oscil(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_oscil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1764, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_161is_oscil, 0, __pyx_n_s_is_oscil, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_oscil, __pyx_t_41) < 0) __PYX_ERR(0, 1764, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_oscil, 1764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 1764, __pyx_L1_error)
 1765:     """
 1766:     returns True if gen is an oscil
 1767:     
 1768:     :param gen: oscil gen
 1769:     :rtype: bool
 1770:     
 1771:     """
+1772:     return cclm.mus_is_oscil(gen._ptr)
  __pyx_r = mus_is_oscil(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 1773: 
 1774: # ---------------- oscil-bank ---------------- #
 1775: 
+1776: cpdef mus_any make_oscil_bank(freqs, phases, amps=None, stable: Optional[bool]=False):
static PyObject *__pyx_pw_8pysndlib_3clm_163make_oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_oscil_bank(PyObject *__pyx_v_freqs, PyObject *__pyx_v_phases, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_oscil_bank *__pyx_optional_args) {
  PyObject *__pyx_v_amps = ((PyObject *)Py_None);
  PyObject *__pyx_v_stable = ((PyObject *)Py_False);
  __Pyx_memviewslice __pyx_v_freqs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_phases_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_amps_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_oscil_bank", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amps = __pyx_optional_args->amps;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_stable = __pyx_optional_args->stable;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_freqs);
  __Pyx_INCREF(__pyx_v_phases);
  __Pyx_INCREF(__pyx_v_amps);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysndlib.clm.make_oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_freqs_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_phases_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_amps_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_freqs);
  __Pyx_XDECREF(__pyx_v_phases);
  __Pyx_XDECREF(__pyx_v_amps);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_163make_oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_162make_oscil_bank, "\n    return a new oscil_bank generator. (freqs in radians)\n    \n    :param freqs: list or np.ndarray of frequencies in radians\n    :param phases: list or np.ndarray of initial phases in radians\n    :param stable:  if it is true, oscil_bank can assume that the frequency. this is not operative\n    :return: oscil_bank gen\n    :rtype: mus_any\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_163make_oscil_bank = {"make_oscil_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_163make_oscil_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_162make_oscil_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_163make_oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_freqs = 0;
  PyObject *__pyx_v_phases = 0;
  PyObject *__pyx_v_amps = 0;
  PyObject *__pyx_v_stable = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_oscil_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_freqs,&__pyx_n_s_phases,&__pyx_n_s_amps,&__pyx_n_s_stable,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_False);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_freqs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1776, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phases)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1776, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_oscil_bank", 0, 2, 4, 1); __PYX_ERR(0, 1776, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amps);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1776, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stable);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1776, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_oscil_bank") < 0)) __PYX_ERR(0, 1776, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_freqs = values[0];
    __pyx_v_phases = values[1];
    __pyx_v_amps = values[2];
    __pyx_v_stable = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_oscil_bank", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1776, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_162make_oscil_bank(__pyx_self, __pyx_v_freqs, __pyx_v_phases, __pyx_v_amps, __pyx_v_stable);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_162make_oscil_bank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_freqs, PyObject *__pyx_v_phases, PyObject *__pyx_v_amps, PyObject *__pyx_v_stable) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_oscil_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.amps = __pyx_v_amps;
  __pyx_t_2.stable = __pyx_v_stable;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_oscil_bank(__pyx_v_freqs, __pyx_v_phases, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__251 = PyTuple_Pack(4, __pyx_n_s_freqs, __pyx_n_s_phases, __pyx_n_s_amps, __pyx_n_s_stable); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_oscil_bank, 1776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 1776, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_stable, __pyx_kp_s_Optional_bool) < 0) __PYX_ERR(0, 1776, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_163make_oscil_bank, 0, __pyx_n_s_make_oscil_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__253);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_oscil_bank, __pyx_t_37) < 0) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__253 = PyTuple_Pack(2, Py_None, Py_False); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_oscil_bank {
  int __pyx_n;
  PyObject *amps;
  PyObject *stable;
};
 1777:     """
 1778:     return a new oscil_bank generator. (freqs in radians)
 1779:     
 1780:     :param freqs: list or np.ndarray of frequencies in radians
 1781:     :param phases: list or np.ndarray of initial phases in radians
 1782:     :param stable:  if it is true, oscil_bank can assume that the frequency. this is not operative
 1783:     :return: oscil_bank gen
 1784:     :rtype: mus_any
 1785:     
 1786:     """
+1787:     cdef cclm.mus_float_t [:] freqs_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __pyx_v_freqs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
+1788:     cdef cclm.mus_float_t [:] phases_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1788, __pyx_L1_error)
  __pyx_v_phases_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
+1789:     cdef cclm.mus_float_t [:] amps_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __pyx_v_amps_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 1790: 
+1791:     if isinstance(freqs, list):
  __pyx_t_2 = PyList_Check(__pyx_v_freqs); 
  if (__pyx_t_2) {
/* … */
  }
+1792:         freqs = np.array(freqs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_freqs);
    __Pyx_GIVEREF(__pyx_v_freqs);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_freqs);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_freqs, __pyx_t_7);
    __pyx_t_7 = 0;
+1793:     if isinstance(phases, list):
  __pyx_t_2 = PyList_Check(__pyx_v_phases); 
  if (__pyx_t_2) {
/* … */
  }
+1794:         phases = np.array(phases, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_phases);
    __Pyx_GIVEREF(__pyx_v_phases);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_phases);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_phases, __pyx_t_6);
    __pyx_t_6 = 0;
 1795: 
+1796:     check_ndim(freqs)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_freqs};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1797:     check_ndim(phases)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_phases};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1798:     compare_shapes(freqs, phases)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_freqs, __pyx_v_phases};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1799: 
+1800:     freqs_view = freqs
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(__pyx_v_freqs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1800, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_freqs_view, 1);
  __pyx_v_freqs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
+1801:     phases_view = phases
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(__pyx_v_phases, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1801, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_phases_view, 1);
  __pyx_v_phases_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 1802: 
+1803:     if amps is not None:
  __pyx_t_2 = (__pyx_v_amps != Py_None);
  if (__pyx_t_2) {
/* … */
    goto __pyx_L5;
  }
+1804:         if isinstance(amps, list):
    __pyx_t_2 = PyList_Check(__pyx_v_amps); 
    if (__pyx_t_2) {
/* … */
    }
+1805:             amps = np.array(amps, dtype=np.double)
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_amps);
      __Pyx_GIVEREF(__pyx_v_amps);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_amps);
      __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_amps, __pyx_t_4);
      __pyx_t_4 = 0;
+1806:         check_ndim(amps)
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_amps};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1806, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+1807:         amps_view = amps
    __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_mus_float_t(__pyx_v_amps, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1807, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_amps_view, 1);
    __pyx_v_amps_view = __pyx_t_1;
    __pyx_t_1.memview = NULL;
    __pyx_t_1.data = NULL;
+1808:         gen = mus_any.from_ptr(cclm.mus_make_oscil_bank(len(freqs), &freqs_view[0], &phases_view[0], &amps_view[0], stable))
    __pyx_t_9 = PyObject_Length(__pyx_v_freqs); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1808, __pyx_L1_error)
    __pyx_t_10 = 0;
    __pyx_t_8 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_v_freqs_view.shape[0];
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_v_freqs_view.shape[0])) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(0, 1808, __pyx_L1_error)
    }
    __pyx_t_11 = 0;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_v_phases_view.shape[0];
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_v_phases_view.shape[0])) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(0, 1808, __pyx_L1_error)
    }
    __pyx_t_12 = 0;
    __pyx_t_8 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_v_amps_view.shape[0];
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_v_amps_view.shape[0])) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(0, 1808, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_stable); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_oscil_bank(__pyx_t_9, (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_freqs_view.data + __pyx_t_10 * __pyx_v_freqs_view.strides[0]) )))), (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_phases_view.data + __pyx_t_11 * __pyx_v_phases_view.strides[0]) )))), (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_amps_view.data + __pyx_t_12 * __pyx_v_amps_view.strides[0]) )))), __pyx_t_2), NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_4);
    __pyx_t_4 = 0;
 1809:     else:
+1810:         gen = mus_any.from_ptr(cclm.mus_make_oscil_bank(len(freqs), &freqs_view[0], &phases_view[0], NULL, stable))
  /*else*/ {
    __pyx_t_9 = PyObject_Length(__pyx_v_freqs); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1810, __pyx_L1_error)
    __pyx_t_12 = 0;
    __pyx_t_8 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_v_freqs_view.shape[0];
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_v_freqs_view.shape[0])) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(0, 1810, __pyx_L1_error)
    }
    __pyx_t_11 = 0;
    __pyx_t_8 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_v_phases_view.shape[0];
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_v_phases_view.shape[0])) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(0, 1810, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_stable); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1810, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_oscil_bank(__pyx_t_9, (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_freqs_view.data + __pyx_t_12 * __pyx_v_freqs_view.strides[0]) )))), (&(*((mus_float_t *) ( /* dim=0 */ (__pyx_v_phases_view.data + __pyx_t_11 * __pyx_v_phases_view.strides[0]) )))), NULL, __pyx_t_2), NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L5:;
 1811: 
+1812:     gen.cache_extend([freqs, phases, amps])
  __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_freqs);
  __Pyx_GIVEREF(__pyx_v_freqs);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_freqs);
  __Pyx_INCREF(__pyx_v_phases);
  __Pyx_GIVEREF(__pyx_v_phases);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_phases);
  __Pyx_INCREF(__pyx_v_amps);
  __Pyx_GIVEREF(__pyx_v_amps);
  PyList_SET_ITEM(__pyx_t_4, 2, __pyx_v_amps);
  __pyx_t_7 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+1813:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 1814: 
+1815: cpdef cython.double oscil_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_165oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_oscil_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oscil_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_165oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_164oscil_bank, "\n    sum an array of oscils\n    \n    :param gen: oscil_bank gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_165oscil_bank = {"oscil_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_165oscil_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_164oscil_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_165oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oscil_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1815, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "oscil_bank") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("oscil_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1815, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_164oscil_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_164oscil_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("oscil_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_oscil_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1815, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1815, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_165oscil_bank, 0, __pyx_n_s_oscil_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_oscil_bank, __pyx_t_41) < 0) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_oscil_bank, 1815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 1815, __pyx_L1_error)
 1816:     """
 1817:     sum an array of oscils
 1818:     
 1819:     :param gen: oscil_bank gen
 1820:     :rtype: float
 1821:     """
+1822:     return cclm.mus_oscil_bank(gen._ptr)
  __pyx_r = mus_oscil_bank(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 1823: 
+1824: cpdef bint is_oscil_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_167is_oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_oscil_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_oscil_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_167is_oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_166is_oscil_bank, "\n    returns True if gen is an oscil_bank\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_167is_oscil_bank = {"is_oscil_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_167is_oscil_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_166is_oscil_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_167is_oscil_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_oscil_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_oscil_bank") < 0)) __PYX_ERR(0, 1824, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_oscil_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1824, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1824, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_166is_oscil_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_166is_oscil_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_oscil_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_oscil_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_oscil_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1824, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_167is_oscil_bank, 0, __pyx_n_s_is_oscil_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_oscil_bank, __pyx_t_37) < 0) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_oscil_bank, 1824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 1824, __pyx_L1_error)
 1825:     """
 1826:     returns True if gen is an oscil_bank
 1827:     
 1828:     :param gen: gen
 1829:     :rtype: bool
 1830:     """
+1831:     return cclm.mus_is_oscil_bank(gen._ptr)
  __pyx_r = mus_is_oscil_bank(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 1832: 
 1833: 
 1834: 
 1835: 
 1836: # ---------------- env ---------------- #
+1837: cpdef mus_any make_env(envelope, scaler: Optional[float]=1.0, duration: Optional[float]=1.0, offset: Optional[float]=0.0, base: Optional[float]=1.0, length: Optional[int]=0):
static PyObject *__pyx_pw_8pysndlib_3clm_169make_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_env(PyObject *__pyx_v_envelope, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_env *__pyx_optional_args) {
  PyObject *__pyx_v_scaler = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_duration = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_offset = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_base = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_length = ((PyObject *)__pyx_int_0);
  __Pyx_memviewslice __pyx_v_envelope_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_env", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_scaler = __pyx_optional_args->scaler;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_duration = __pyx_optional_args->duration;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_offset = __pyx_optional_args->offset;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_base = __pyx_optional_args->base;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_length = __pyx_optional_args->length;
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_envelope);
  __Pyx_INCREF(__pyx_v_duration);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_envelope_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_envelope);
  __Pyx_XDECREF(__pyx_v_duration);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_169make_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_168make_env, "\n    return a new envelope generator.  'envelope' is a list/array of break-point pairs. to create the\n    envelope, these points are offset by 'offset', scaled by 'scaler', and mapped over the time interval\n    defined by either 'duration' (seconds) or 'length' (samples).  if 'base' is 1.0, the connecting segments\n    are linear, if 0.0 you get a step function, and anything else produces an exponential connecting segment.\n    \n    :param envelope: list or np.ndarry of breakpoint pairs\n    :param scaler: scaler on every y value (before offset is added)\n    :param duration: duration \\in seconds\n    :param offset: value added to every y value\n    :param base: type of connecting line between break-points\n    :param length:  duration \\in samples\n    :result: env gen\n    :rtype: mus_any\n\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_169make_env = {"make_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_169make_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_168make_env};
static PyObject *__pyx_pw_8pysndlib_3clm_169make_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_envelope = 0;
  PyObject *__pyx_v_scaler = 0;
  PyObject *__pyx_v_duration = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_v_length = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_envelope,&__pyx_n_s_scaler,&__pyx_n_s_duration,&__pyx_n_s_offset,&__pyx_n_s_base,&__pyx_n_s_length,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)__pyx_float_1_0);
    values[3] = ((PyObject *)__pyx_float_0_0);
    values[4] = ((PyObject *)__pyx_float_1_0);
    values[5] = ((PyObject *)__pyx_int_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scaler);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_duration);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_env") < 0)) __PYX_ERR(0, 1837, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_envelope = values[0];
    __pyx_v_scaler = values[1];
    __pyx_v_duration = values[2];
    __pyx_v_offset = values[3];
    __pyx_v_base = values[4];
    __pyx_v_length = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_env", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 1837, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_168make_env(__pyx_self, __pyx_v_envelope, __pyx_v_scaler, __pyx_v_duration, __pyx_v_offset, __pyx_v_base, __pyx_v_length);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_168make_env(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_envelope, PyObject *__pyx_v_scaler, PyObject *__pyx_v_duration, PyObject *__pyx_v_offset, PyObject *__pyx_v_base, PyObject *__pyx_v_length) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.scaler = __pyx_v_scaler;
  __pyx_t_2.duration = __pyx_v_duration;
  __pyx_t_2.offset = __pyx_v_offset;
  __pyx_t_2.base = __pyx_v_base;
  __pyx_t_2.length = __pyx_v_length;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_env(__pyx_v_envelope, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__256 = PyTuple_Pack(6, __pyx_n_s_envelope, __pyx_n_s_scaler, __pyx_n_s_duration, __pyx_n_s_offset, __pyx_n_s_base, __pyx_n_s_length); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_env, 1837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 1837, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_scaler, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_duration, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_offset, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_base, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_length, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_169make_env, 0, __pyx_n_s_make_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__258);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_env, __pyx_t_41) < 0) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__258 = PyTuple_Pack(5, __pyx_float_1_0, __pyx_float_1_0, __pyx_float_0_0, __pyx_float_1_0, __pyx_int_0); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_env {
  int __pyx_n;
  PyObject *scaler;
  PyObject *duration;
  PyObject *offset;
  PyObject *base;
  PyObject *length;
};
 1838:     """
 1839:     return a new envelope generator.  'envelope' is a list/array of break-point pairs. to create the
 1840:     envelope, these points are offset by 'offset', scaled by 'scaler', and mapped over the time interval
 1841:     defined by either 'duration' (seconds) or 'length' (samples).  if 'base' is 1.0, the connecting segments
 1842:     are linear, if 0.0 you get a step function, and anything else produces an exponential connecting segment.
 1843:     
 1844:     :param envelope: list or np.ndarry of breakpoint pairs
 1845:     :param scaler: scaler on every y value (before offset is added)
 1846:     :param duration: duration \in seconds
 1847:     :param offset: value added to every y value
 1848:     :param base: type of connecting line between break-points
 1849:     :param length:  duration \in samples
 1850:     :result: env gen
 1851:     :rtype: mus_any
 1852: 
 1853:     """
+1854:     validate_envelope(envelope)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_validate_envelope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_envelope};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1855:     check_range('duration', duration, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_duration, __pyx_v_duration, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1856: 
+1857:     if length > 0:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_length, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1857, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
/* … */
  }
+1858:         duration = samples2seconds(length)
    __pyx_t_6 = __pyx_f_8pysndlib_3clm_samples2seconds(__pyx_v_length, 0); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1858, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_duration, __pyx_t_1);
    __pyx_t_1 = 0;
 1859: 
+1860:     if isinstance(envelope, list):
  __pyx_t_5 = PyList_Check(__pyx_v_envelope); 
  if (__pyx_t_5) {
/* … */
  }
+1861:         envelope = np.array(envelope, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_envelope);
    __Pyx_GIVEREF(__pyx_v_envelope);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_envelope);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_envelope, __pyx_t_8);
    __pyx_t_8 = 0;
 1862: 
+1863:     check_ndim(envelope)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_envelope};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 1864: 
+1865:     cdef double [:] envelope_view = envelope
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_envelope, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __pyx_v_envelope_view = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;
 1866: 
+1867:     gen =  mus_any.from_ptr(cclm.mus_make_env(&envelope_view[0], len(envelope) // 2, scaler, offset, base, duration, 0, NULL))
  __pyx_t_10 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_v_envelope_view.shape[0];
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_v_envelope_view.shape[0])) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    __PYX_ERR(0, 1867, __pyx_L1_error)
  }
  __pyx_t_11 = PyObject_Length(__pyx_v_envelope); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1867, __pyx_L1_error)
  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_scaler); if (unlikely((__pyx_t_12 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L1_error)
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_offset); if (unlikely((__pyx_t_13 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L1_error)
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_base); if (unlikely((__pyx_t_14 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L1_error)
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_duration); if (unlikely((__pyx_t_15 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L1_error)
  __pyx_t_8 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_env((&(*((double *) ( /* dim=0 */ (__pyx_v_envelope_view.data + __pyx_t_10 * __pyx_v_envelope_view.strides[0]) )))), __Pyx_div_Py_ssize_t(__pyx_t_11, 2), __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, 0, NULL), NULL)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_8);
  __pyx_t_8 = 0;
+1868:     gen.cache_append(envelope)
  __pyx_t_8 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_envelope, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1869:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 1870: 
+1871: cpdef cython.double env(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_171env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_env(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_171env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_170env, "\n    next sample from envelope generator.\n    \n    :param gen: env gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_171env = {"env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_171env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_170env};
static PyObject *__pyx_pw_8pysndlib_3clm_171env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1871, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "env") < 0)) __PYX_ERR(0, 1871, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("env", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1871, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1871, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_170env(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_170env(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_env(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1871, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1871, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_171env, 0, __pyx_n_s_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_env, __pyx_t_37) < 0) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_env, 1871, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1871, __pyx_L1_error)
 1872:     """
 1873:     next sample from envelope generator.
 1874:     
 1875:     :param gen: env gen
 1876:     :rtype: float
 1877:     """
+1878:     return cclm.mus_env(gen._ptr)
  __pyx_r = mus_env(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 1879: 
+1880: cpdef bint is_env(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_173is_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_env(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_env", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_173is_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_172is_env, "\n    returns True if gen is an env.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_173is_env = {"is_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_173is_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_172is_env};
static PyObject *__pyx_pw_8pysndlib_3clm_173is_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_env") < 0)) __PYX_ERR(0, 1880, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_env", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1880, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1880, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_172is_env(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_172is_env(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_env(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1880, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_173is_env, 0, __pyx_n_s_is_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_env, __pyx_t_41) < 0) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_env, 1880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 1880, __pyx_L1_error)
 1881:     """
 1882:     returns True if gen is an env.
 1883:     
 1884:     :param gen: gen
 1885:     :rtype: bool
 1886:     """
+1887:     return cclm.mus_is_env(gen._ptr)
  __pyx_r = mus_is_env(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 1888: 
+1889: cpdef cython.double env_interp(x: cython.double, env: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_175env_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_env_interp(double __pyx_v_x, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_env, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env_interp", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_175env_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_174env_interp, "\n    value of envelope env at x.\n    \n    :param x: location \\in envelope\n    :param env: env gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_175env_interp = {"env_interp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_175env_interp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_174env_interp};
static PyObject *__pyx_pw_8pysndlib_3clm_175env_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_env = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env_interp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_env,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_env)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("env_interp", 1, 2, 2, 1); __PYX_ERR(0, 1889, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "env_interp") < 0)) __PYX_ERR(0, 1889, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L3_error)
    __pyx_v_env = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("env_interp", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1889, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.env_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_env), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "env", 0))) __PYX_ERR(0, 1889, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_174env_interp(__pyx_self, __pyx_v_x, __pyx_v_env);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_174env_interp(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_env) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env_interp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_env_interp(__pyx_v_x, __pyx_v_env, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.env_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__261 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_env); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 1889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1889, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_env, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1889, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_175env_interp, 0, __pyx_n_s_env_interp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_env_interp, __pyx_t_37) < 0) __PYX_ERR(0, 1889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_env_interp, 1889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 1889, __pyx_L1_error)
 1890:     """
 1891:     value of envelope env at x.
 1892:     
 1893:     :param x: location \in envelope
 1894:     :param env: env gen
 1895:     :rtype: float
 1896:     """
+1897:     return cclm.mus_env_interp(x, env._ptr)
  __pyx_r = mus_env_interp(__pyx_v_x, __pyx_v_env->_ptr);
  goto __pyx_L0;
 1898: 
+1899: cpdef cython.double envelope_interp(x: cython.double, env: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_177envelope_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_envelope_interp(double __pyx_v_x, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_env, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("envelope_interp", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_177envelope_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_176envelope_interp, "\n    value of envelope env at x.\n    \n    :param x: location \\in envelope\n    :param env: env gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_177envelope_interp = {"envelope_interp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_177envelope_interp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_176envelope_interp};
static PyObject *__pyx_pw_8pysndlib_3clm_177envelope_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_x;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_env = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("envelope_interp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_env,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_env)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("envelope_interp", 1, 2, 2, 1); __PYX_ERR(0, 1899, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "envelope_interp") < 0)) __PYX_ERR(0, 1899, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
    __pyx_v_env = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("envelope_interp", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1899, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.envelope_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_env), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "env", 0))) __PYX_ERR(0, 1899, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_176envelope_interp(__pyx_self, __pyx_v_x, __pyx_v_env);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_176envelope_interp(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_env) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("envelope_interp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_envelope_interp(__pyx_v_x, __pyx_v_env, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.envelope_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_x, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1899, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_env, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1899, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_177envelope_interp, 0, __pyx_n_s_envelope_interp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_envelope_interp, __pyx_t_41) < 0) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_envelope_interp, 1899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 1899, __pyx_L1_error)
 1900:     """
 1901:     value of envelope env at x.
 1902:     
 1903:     :param x: location \in envelope
 1904:     :param env: env gen
 1905:     :rtype: float
 1906:     """
+1907:     return cclm.mus_env_interp(x, env._ptr)
  __pyx_r = mus_env_interp(__pyx_v_x, __pyx_v_env->_ptr);
  goto __pyx_L0;
 1908: 
 1909: # this is slow because of needing ctypes to define function at runtime
 1910: # but no other way to do it with cython without changing sndlib code
+1911: cpdef cython.double env_any(gen: mus_any, connection_function):
static PyObject *__pyx_pw_8pysndlib_3clm_179env_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_env_any(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_connection_function, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_f = NULL;
  connect_points_cb __pyx_v_cy_f_ptr;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env_any", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.env_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_179env_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_178env_any, "\n    generate env output using conncection_func to 'connect the dots'.\n    \n    the env-any connecting function takes one argument, the current envelope value treated as going between 0.0 and 1.0 between each two points. \n    :param env: env gen\n    :param connection_function: function used to connect points\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_179env_any = {"env_any", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_179env_any, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_178env_any};
static PyObject *__pyx_pw_8pysndlib_3clm_179env_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_connection_function = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env_any (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_connection_function,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_connection_function)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("env_any", 1, 2, 2, 1); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "env_any") < 0)) __PYX_ERR(0, 1911, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_connection_function = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("env_any", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1911, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.env_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1911, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_178env_any(__pyx_self, __pyx_v_gen, __pyx_v_connection_function);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_178env_any(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_connection_function) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("env_any", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_env_any(__pyx_v_gen, __pyx_v_connection_function, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1911, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.env_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__264 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_connection_function); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1911, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_179env_any, 0, __pyx_n_s_env_any, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_env_any, __pyx_t_37) < 0) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_env_any, 1911, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 1911, __pyx_L1_error)
 1912:     """
 1913:     generate env output using conncection_func to 'connect the dots'.
 1914:     
 1915:     the env-any connecting function takes one argument, the current envelope value treated as going between 0.0 and 1.0 between each two points. 
 1916:     :param env: env gen
 1917:     :param connection_function: function used to connect points
 1918:     :rtype: float
 1919:     """
 1920: 
+1921:     f = ENVFUNCTION(connection_function)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ENVFUNCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_connection_function};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;
+1922:     cdef cclm.connect_points_cb cy_f_ptr = (<cclm.connect_points_cb*><size_t>ctypes.addressof(f))[0]
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_addressof); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_f};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cy_f_ptr = (((connect_points_cb *)((size_t)__pyx_t_5))[0]);
+1923:     return cclm.mus_env_any(gen._ptr, cy_f_ptr)
  __pyx_r = mus_env_any(__pyx_v_gen->_ptr, __pyx_v_cy_f_ptr);
  goto __pyx_L0;
 1924: 
 1925: 
 1926: # ---------------- pulsed-env ---------------- #    
+1927: cpdef mus_any make_pulsed_env(envelope, duration: cython.double, frequency: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_181make_pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_pulsed_env(PyObject *__pyx_v_envelope, double __pyx_v_duration, double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_pl = NULL;
  __Pyx_memviewslice __pyx_v_envelope_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_ge = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pulsed_env", 0);
  __Pyx_INCREF(__pyx_v_envelope);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pl);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_envelope_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_ge);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_envelope);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_181make_pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_180make_pulsed_env, "\n    produces a repeating envelope. env sticks at its last value, but pulsed-env repeats it over and over. \n    \n    :param env: env gen\n    :param duration: duration of envelope\n    :param frequency: repetition rate \\in hz\n    :return: env output\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_181make_pulsed_env = {"make_pulsed_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_181make_pulsed_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_180make_pulsed_env};
static PyObject *__pyx_pw_8pysndlib_3clm_181make_pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_envelope = 0;
  double __pyx_v_duration;
  double __pyx_v_frequency;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pulsed_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_envelope,&__pyx_n_s_duration,&__pyx_n_s_frequency,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_duration)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_pulsed_env", 1, 3, 3, 1); __PYX_ERR(0, 1927, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_pulsed_env", 1, 3, 3, 2); __PYX_ERR(0, 1927, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_pulsed_env") < 0)) __PYX_ERR(0, 1927, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_envelope = values[0];
    __pyx_v_duration = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_duration == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_pulsed_env", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1927, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_180make_pulsed_env(__pyx_self, __pyx_v_envelope, __pyx_v_duration, __pyx_v_frequency);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_180make_pulsed_env(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_envelope, double __pyx_v_duration, double __pyx_v_frequency) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pulsed_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_pulsed_env(__pyx_v_envelope, __pyx_v_duration, __pyx_v_frequency, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__266 = PyTuple_Pack(3, __pyx_n_s_envelope, __pyx_n_s_duration, __pyx_n_s_frequency); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_duration, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_181make_pulsed_env, 0, __pyx_n_s_make_pulsed_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_pulsed_env, __pyx_t_41) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_pulsed_env, 1927, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 1927, __pyx_L1_error)
 1928:     """
 1929:     produces a repeating envelope. env sticks at its last value, but pulsed-env repeats it over and over. 
 1930:     
 1931:     :param env: env gen
 1932:     :param duration: duration of envelope
 1933:     :param frequency: repetition rate \in hz
 1934:     :return: env output
 1935:     :rtype: float
 1936:     """
 1937: 
+1938:     if isinstance(envelope, list):
  __pyx_t_1 = PyList_Check(__pyx_v_envelope); 
  if (__pyx_t_1) {
/* … */
  }
+1939:         envelope = np.array(envelope, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_envelope);
    __Pyx_GIVEREF(__pyx_v_envelope);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_envelope);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_envelope, __pyx_t_6);
    __pyx_t_6 = 0;
 1940: 
+1941:     pl = mus_any.from_ptr(cclm.mus_make_pulse_train(frequency, 1.0, 0.0))
  __pyx_t_6 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_pulse_train(__pyx_v_frequency, 1.0, 0.0), NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_pl = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_6);
  __pyx_t_6 = 0;
 1942: 
+1943:     check_ndim(envelope)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_envelope};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 1944: 
+1945:     cdef double [:] envelope_view = envelope
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_envelope, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __pyx_v_envelope_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 1946: 
+1947:     ge =  mus_any.from_ptr(cclm.mus_make_env(&envelope_view[0], len(envelope) // 2, 1.0, 0, 1.0, duration, 0, NULL))
  __pyx_t_9 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_v_envelope_view.shape[0];
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_9 >= __pyx_v_envelope_view.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(0, 1947, __pyx_L1_error)
  }
  __pyx_t_10 = PyObject_Length(__pyx_v_envelope); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1947, __pyx_L1_error)
  __pyx_t_6 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_env((&(*((double *) ( /* dim=0 */ (__pyx_v_envelope_view.data + __pyx_t_9 * __pyx_v_envelope_view.strides[0]) )))), __Pyx_div_Py_ssize_t(__pyx_t_10, 2), 1.0, 0.0, 1.0, __pyx_v_duration, 0, NULL), NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_ge = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_6);
  __pyx_t_6 = 0;
+1948:     gen = mus_any.from_ptr(cclm.mus_make_pulsed_env(ge._ptr, pl._ptr))
  __pyx_t_6 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_pulsed_env(__pyx_v_ge->_ptr, __pyx_v_pl->_ptr), NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_6);
  __pyx_t_6 = 0;
+1949:     gen.cache_extend([pl, ge, envelope])
  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF((PyObject *)__pyx_v_pl);
  __Pyx_GIVEREF((PyObject *)__pyx_v_pl);
  PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_pl));
  __Pyx_INCREF((PyObject *)__pyx_v_ge);
  __Pyx_GIVEREF((PyObject *)__pyx_v_ge);
  PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_ge));
  __Pyx_INCREF(__pyx_v_envelope);
  __Pyx_GIVEREF(__pyx_v_envelope);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_v_envelope);
  __pyx_t_4 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+1950:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 1951: 
+1952: cpdef cython.double pulsed_env(gen: mus_any, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_183pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_pulsed_env(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_pulsed_env *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pulsed_env", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_183pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_182pulsed_env, "\n    next sample from envelope generator.\n    \n    :param gen: env gen\n    :param fm: change frequency of repetition\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_183pulsed_env = {"pulsed_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_183pulsed_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_182pulsed_env};
static PyObject *__pyx_pw_8pysndlib_3clm_183pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pulsed_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pulsed_env") < 0)) __PYX_ERR(0, 1952, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pulsed_env", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1952, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_182pulsed_env(__pyx_self, __pyx_v_gen, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_182pulsed_env(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pulsed_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_pulsed_env(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__268 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_fm); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);
  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_pulsed_env, 1952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 1952, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_183pulsed_env, 0, __pyx_n_s_pulsed_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pulsed_env, __pyx_t_37) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__270 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_pulsed_env {
  int __pyx_n;
  PyObject *fm;
};
 1953:     """
 1954:     next sample from envelope generator.
 1955:     
 1956:     :param gen: env gen
 1957:     :param fm: change frequency of repetition
 1958:     :rtype: float
 1959:     """
+1960:     if(fm):
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1960, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+1961:         return cclm.mus_pulsed_env(gen._ptr, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1961, __pyx_L1_error)
    __pyx_r = mus_pulsed_env(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 1962:     else:
+1963:         return cclm.mus_pulsed_env_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_pulsed_env_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 1964: 
+1965: cpdef bint is_pulsed_env(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_185is_pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_pulsed_env(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pulsed_env", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_185is_pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_184is_pulsed_env, "\n    returns True if gen is a pulsed_env.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_185is_pulsed_env = {"is_pulsed_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_185is_pulsed_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_184is_pulsed_env};
static PyObject *__pyx_pw_8pysndlib_3clm_185is_pulsed_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pulsed_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_pulsed_env") < 0)) __PYX_ERR(0, 1965, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_pulsed_env", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1965, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 1965, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_184is_pulsed_env(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_184is_pulsed_env(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pulsed_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_pulsed_env(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_pulsed_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 1965, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_185is_pulsed_env, 0, __pyx_n_s_is_pulsed_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_pulsed_env, __pyx_t_41) < 0) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_pulsed_env, 1965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 1965, __pyx_L1_error)
 1966:     """
 1967:     returns True if gen is a pulsed_env.
 1968:     
 1969:     :param gen: gen
 1970:     :rtype: bool
 1971:     """
+1972:     return cclm.mus_is_pulsed_env(gen._ptr)
  __pyx_r = mus_is_pulsed_env(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 1973: 
 1974: # todo envelope-interp different than env-interp
 1975: 
 1976: # ---------------- table-lookup ---------------- #
+1977: cpdef mus_any make_table_lookup(frequency: Optional[float]=0.0,
static PyObject *__pyx_pw_8pysndlib_3clm_187make_table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_table_lookup(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_table_lookup *__pyx_optional_args) {
  PyObject *__pyx_v_frequency = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_initial_phase = ((PyObject *)__pyx_float_0_0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_wave_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_wave);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_187make_table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_186make_table_lookup, "\n    return a new table_lookup generator. the default table size is 512; use size to set some other\n    size, or pass your own list/array as the 'wave'.\n    \n    :param frequency: frequency of gen \\in hz\n    :param initial_phase: initial phase of gen \\in radians\n    :param wave: np.ndarray if provided is waveform\n    :param size: if no wave provided, this will allocate a table of size \n    :param interp_type: type of interpolation used\n    :return: table_lookup gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_187make_table_lookup = {"make_table_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_187make_table_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_186make_table_lookup};
static PyObject *__pyx_pw_8pysndlib_3clm_187make_table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_frequency = 0;
  PyObject *__pyx_v_initial_phase = 0;
  PyObject *__pyx_v_wave = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_table_lookup (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_initial_phase,&__pyx_n_s_wave,&__pyx_n_s_size,&__pyx_n_s_interp_type,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_float_0_0);
    values[1] = ((PyObject *)__pyx_float_0_0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_186make_table_lookup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_initial_phase, PyObject *__pyx_v_wave, PyObject *__pyx_v_size, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_table_lookup", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.frequency = __pyx_v_frequency;
  __pyx_t_2.initial_phase = __pyx_v_initial_phase;
  __pyx_t_2.wave = __pyx_v_wave;
  __pyx_t_2.size = __pyx_v_size;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_table_lookup(0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__272 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_initial_phase, __pyx_n_s_wave, __pyx_n_s_size, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);
/* … */
  __pyx_t_40 = PyTuple_New(5); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_float_0_0);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_40, 1, __pyx_float_0_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_40, 2, Py_None);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_40, 3, __pyx_t_41);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_40, 4, __pyx_t_37);
  __pyx_t_41 = 0;
  __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_initial_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 1977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_interp_type, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 1977, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_187make_table_lookup, 0, __pyx_n_s_make_table_lookup, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_table_lookup, __pyx_t_41) < 0) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_table_lookup, 1977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 1977, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_table_lookup {
  int __pyx_n;
  PyObject *frequency;
  PyObject *initial_phase;
  PyObject *wave;
  PyObject *size;
  PyObject *interp_type;
};
 1978:                         initial_phase: Optional[float]=0.0,
+1979:                         wave=None,
  PyObject *__pyx_v_wave = ((PyObject *)Py_None);
  PyObject *__pyx_v_size = __pyx_k__27;
  PyObject *__pyx_v_interp_type = __pyx_k__28;
  __Pyx_memviewslice __pyx_v_wave_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_table_lookup", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_frequency = __pyx_optional_args->frequency;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_phase = __pyx_optional_args->initial_phase;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_wave = __pyx_optional_args->wave;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_size = __pyx_optional_args->size;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_interp_type = __pyx_optional_args->interp_type;
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_wave);
/* … */
    values[2] = ((PyObject *)Py_None);
    values[3] = __pyx_k__27;
    values[4] = __pyx_k__28;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_phase);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wave);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1977, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_table_lookup") < 0)) __PYX_ERR(0, 1977, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = values[0];
    __pyx_v_initial_phase = values[1];
    __pyx_v_wave = values[2];
    __pyx_v_size = values[3];
    __pyx_v_interp_type = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_table_lookup", 0, 0, 5, __pyx_nargs); __PYX_ERR(0, 1977, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_186make_table_lookup(__pyx_self, __pyx_v_frequency, __pyx_v_initial_phase, __pyx_v_wave, __pyx_v_size, __pyx_v_interp_type);
+1980:                         size: Optional[int]=CLM.table_size,
  __Pyx_GetModuleGlobalName(__pyx_t_41, __pyx_n_s_CLM); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_table_size); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_k__27 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_CLM); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_table_size); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
+1981:                         interp_type: Optional[int]=Interp.LINEAR):
  __pyx_t_37 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_k__28 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __pyx_t_37 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
 1982:     """
 1983:     return a new table_lookup generator. the default table size is 512; use size to set some other
 1984:     size, or pass your own list/array as the 'wave'.
 1985:     
 1986:     :param frequency: frequency of gen \in hz
 1987:     :param initial_phase: initial phase of gen \in radians
 1988:     :param wave: np.ndarray if provided is waveform
 1989:     :param size: if no wave provided, this will allocate a table of size 
 1990:     :param interp_type: type of interpolation used
 1991:     :return: table_lookup gen
 1992:     :rtype: mus_any
 1993:     """
 1994: 
+1995:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1995, __pyx_L1_error)
  __pyx_t_4 = PyFloat_FromDouble((__pyx_t_3 / 2.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_frequency, __pyx_v_frequency, __pyx_float_0_0, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1996: 
+1997:     if wave is None:
  __pyx_t_7 = (__pyx_v_wave == Py_None);
  if (__pyx_t_7) {
/* … */
  }
+1998:         wave = np.zeros(size)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_size};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_1);
    __pyx_t_1 = 0;
 1999: 
+2000:     if isinstance(wave, list):
  __pyx_t_7 = PyList_Check(__pyx_v_wave); 
  if (__pyx_t_7) {
/* … */
  }
+2001:         wave = np.array(wave, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_wave);
    __Pyx_GIVEREF(__pyx_v_wave);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_wave);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_8);
    __pyx_t_8 = 0;
 2002: 
+2003:     check_ndim(wave)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_wave};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 2004: 
+2005:     cdef double [:] wave_view = wave
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_wave, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2005, __pyx_L1_error)
  __pyx_v_wave_view = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;
 2006: 
 2007:     #print(frequency, initial_phase, wave, size, interp_type)
+2008:     gen =  mus_any.from_ptr(cclm.mus_make_table_lookup(frequency, initial_phase, &wave_view[0], size, interp_type))
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_frequency); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L1_error)
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_initial_phase); if (unlikely((__pyx_t_11 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L1_error)
  __pyx_t_12 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_wave_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_wave_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 2008, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_PyInt_As_mus_long_t(__pyx_v_size); if (unlikely((__pyx_t_13 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L1_error)
  __pyx_t_14 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L1_error)
  __pyx_t_8 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_table_lookup(__pyx_t_10, __pyx_t_11, (&(*((double *) ( /* dim=0 */ (__pyx_v_wave_view.data + __pyx_t_12 * __pyx_v_wave_view.strides[0]) )))), __pyx_t_13, __pyx_t_14), NULL)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_8);
  __pyx_t_8 = 0;
+2009:     gen.cache_append(wave)
  __pyx_t_8 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_wave, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2010:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 2011: 
+2012: cpdef cython.double table_lookup(gen: mus_any, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_189table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_table_lookup(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_table_lookup *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table_lookup", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_189table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_188table_lookup, "\n    return next sample from table_lookup generator.\n    \n    :param gen: table_lookup gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_189table_lookup = {"table_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_189table_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_188table_lookup};
static PyObject *__pyx_pw_8pysndlib_3clm_189table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table_lookup (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "table_lookup") < 0)) __PYX_ERR(0, 2012, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("table_lookup", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2012, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2012, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_188table_lookup(__pyx_self, __pyx_v_gen, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_188table_lookup(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table_lookup", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_table_lookup(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_189table_lookup, 0, __pyx_n_s_table_lookup, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_table_lookup, __pyx_t_37) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_table_lookup, 2012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 2012, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_table_lookup {
  int __pyx_n;
  PyObject *fm;
};
 2013:     """
 2014:     return next sample from table_lookup generator.
 2015:     
 2016:     :param gen: table_lookup gen
 2017:     :param fm: fm input
 2018:     :rtype: float
 2019:     """
+2020:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2020, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2021:         return cclm.mus_table_lookup(gen._ptr, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2021, __pyx_L1_error)
    __pyx_r = mus_table_lookup(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 2022:     else:
+2023:         return cclm.mus_table_lookup_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_table_lookup_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 2024: 
+2025: cpdef bint is_table_lookup(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_191is_table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_table_lookup(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_table_lookup", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_191is_table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_190is_table_lookup, "\n    returns True if gen is a table_lookup.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_191is_table_lookup = {"is_table_lookup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_191is_table_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_190is_table_lookup};
static PyObject *__pyx_pw_8pysndlib_3clm_191is_table_lookup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_table_lookup (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_table_lookup") < 0)) __PYX_ERR(0, 2025, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_table_lookup", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2025, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2025, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_190is_table_lookup(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_190is_table_lookup(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_table_lookup", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_table_lookup(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_table_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2025, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_191is_table_lookup, 0, __pyx_n_s_is_table_lookup, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_table_lookup, __pyx_t_41) < 0) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_table_lookup, 2025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 2025, __pyx_L1_error)
 2026:     """
 2027:     returns True if gen is a table_lookup.
 2028:     
 2029:     :param gen: gen
 2030:     :rtype: bool
 2031:     """
+2032:     return cclm.mus_is_table_lookup(gen._ptr)
  __pyx_r = mus_is_table_lookup(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2033: 
 2034: 
+2035: cpdef mus_any make_table_lookup_with_env(frequency: cython.double, envelope, size=None):
static PyObject *__pyx_pw_8pysndlib_3clm_193make_table_lookup_with_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_table_lookup_with_env(double __pyx_v_frequency, PyObject *__pyx_v_envelope, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_table_lookup_with_env *__pyx_optional_args) {
  PyObject *__pyx_v_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_table = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_e = NULL;
  PyObject *__pyx_v_i = NULL;
  __Pyx_memviewslice __pyx_v_table_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_table_lookup_with_env", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_size = __pyx_optional_args->size;
    }
  }
  __Pyx_INCREF(__pyx_v_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_table_lookup_with_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF((PyObject *)__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_i);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_table_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_193make_table_lookup_with_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_192make_table_lookup_with_env, "\n    return a new table_lookup generator with the envelope loaded \\in with size.\n    \n    :param frequency: frequency of gen \\in hz\n    :param env: envelope shape to load into generator\n    :param size: size of table derived from envelope\n    :return: table_lookup gen\n    :rtype: mus_any\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_193make_table_lookup_with_env = {"make_table_lookup_with_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_193make_table_lookup_with_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_192make_table_lookup_with_env};
static PyObject *__pyx_pw_8pysndlib_3clm_193make_table_lookup_with_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_envelope = 0;
  PyObject *__pyx_v_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_table_lookup_with_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_envelope,&__pyx_n_s_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2035, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2035, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_table_lookup_with_env", 0, 2, 3, 1); __PYX_ERR(0, 2035, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2035, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_table_lookup_with_env") < 0)) __PYX_ERR(0, 2035, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2035, __pyx_L3_error)
    __pyx_v_envelope = values[1];
    __pyx_v_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_table_lookup_with_env", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2035, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_table_lookup_with_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_192make_table_lookup_with_env(__pyx_self, __pyx_v_frequency, __pyx_v_envelope, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_192make_table_lookup_with_env(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_envelope, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_table_lookup_with_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.size = __pyx_v_size;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_table_lookup_with_env(__pyx_v_frequency, __pyx_v_envelope, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_table_lookup_with_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__276 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_envelope, __pyx_n_s_size); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 2035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 2035, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_193make_table_lookup_with_env, 0, __pyx_n_s_make_table_lookup_with_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_table_lookup_with_env, __pyx_t_37) < 0) __PYX_ERR(0, 2035, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_table_lookup_with_env, 2035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 2035, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_table_lookup_with_env {
  int __pyx_n;
  PyObject *size;
};
 2036:     """
 2037:     return a new table_lookup generator with the envelope loaded \in with size.
 2038:     
 2039:     :param frequency: frequency of gen \in hz
 2040:     :param env: envelope shape to load into generator
 2041:     :param size: size of table derived from envelope
 2042:     :return: table_lookup gen
 2043:     :rtype: mus_any
 2044:     
 2045:     """
 2046: 
+2047:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2047, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2048: 
+2049:     size = size or CLM.table_size
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_size); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 2049, __pyx_L1_error)
  if (!__pyx_t_8) {
  } else {
    __Pyx_INCREF(__pyx_v_size);
    __pyx_t_1 = __pyx_v_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_table_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_1);
  __pyx_t_1 = 0;
+2050:     table = np.zeros(size)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_size};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_table = __pyx_t_1;
  __pyx_t_1 = 0;
+2051:     e = make_env(envelope, length=size)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_make_env); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_envelope);
  __Pyx_GIVEREF(__pyx_v_envelope);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_envelope);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_length, __pyx_v_size) < 0) __PYX_ERR(0, 2051, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8pysndlib_3clm_mus_any))))) __PYX_ERR(0, 2051, __pyx_L1_error)
  __pyx_v_e = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
  __pyx_t_3 = 0;
+2052:     for i in range(size):
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2052, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 2052, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 2052, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2052, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;
/* … */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2053:         table[i] = env(e)
    __pyx_t_4 = __pyx_f_8pysndlib_3clm_env(__pyx_v_e, 0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2053, __pyx_L1_error)
    __pyx_t_3 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((PyObject_SetItem(__pyx_v_table, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2054:     cdef double [:] table_view = table
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_table, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2054, __pyx_L1_error)
  __pyx_v_table_view = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;
 2055: 
+2056:     gen =  mus_any.from_ptr(cclm.mus_make_table_lookup(frequency, 0, &table_view[0], size, <cclm.mus_interp_t>Interp.LINEAR))
  __pyx_t_12 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_table_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_table_view.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(0, 2056, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_PyInt_As_mus_long_t(__pyx_v_size); if (unlikely((__pyx_t_13 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2056, __pyx_L1_error)
  __pyx_t_5 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_table_lookup(__pyx_v_frequency, 0.0, (&(*((double *) ( /* dim=0 */ (__pyx_v_table_view.data + __pyx_t_12 * __pyx_v_table_view.strides[0]) )))), __pyx_t_13, ((mus_interp_t)__pyx_e_8pysndlib_3clm_LINEAR)), NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_5);
  __pyx_t_5 = 0;
+2057:     gen.cache_append(table)
  __pyx_t_5 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_table, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2058:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 2059: 
 2060: # ---------------- polywave ---------------- #
+2061: cpdef mus_any make_polywave(frequency: float,  partials = [0.,1.],
static PyObject *__pyx_pw_8pysndlib_3clm_195make_polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_polywave(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_polywave *__pyx_optional_args) {
  PyObject *__pyx_v_partials = __pyx_k__29;
  PyObject *__pyx_v_kind = __pyx_k__30;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xcoeffs_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ycoeffs_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_prtls_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_prtls);
  __Pyx_XDECREF(__pyx_v_xcoeffs);
  __Pyx_XDECREF(__pyx_v_ycoeffs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_195make_polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_194make_polywave, "\n    return a new polynomial-based waveshaping generator. make_polywave(440.0, partials=[1.0,1.0]) is\n    the same \\in effect as make_oscil.\n    \n    :param frequency: polywave frequency\n    :param partials: a list of harmonic numbers and their associated amplitudes\n    :param kind: Chebyshev polynomial choice\n    :param xcoeffs: tn for tu-sum case\n    :param ycoeffs: un for tu-sum case\n    :return: polywave gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_195make_polywave = {"make_polywave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_195make_polywave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_194make_polywave};
static PyObject *__pyx_pw_8pysndlib_3clm_195make_polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_partials = 0;
  PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_v_xcoeffs = 0;
  PyObject *__pyx_v_ycoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_polywave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_partials,&__pyx_n_s_kind,&__pyx_n_s_xcoeffs,&__pyx_n_s_ycoeffs,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = __pyx_k__29;
    values[2] = __pyx_k__30;
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_194make_polywave(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_partials, PyObject *__pyx_v_kind, PyObject *__pyx_v_xcoeffs, PyObject *__pyx_v_ycoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_polywave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.partials = __pyx_v_partials;
  __pyx_t_2.kind = __pyx_v_kind;
  __pyx_t_2.xcoeffs = __pyx_v_xcoeffs;
  __pyx_t_2.ycoeffs = __pyx_v_ycoeffs;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_polywave(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = PyList_New(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_0_);
  __Pyx_GIVEREF(__pyx_float_0_);
  PyList_SET_ITEM(__pyx_t_37, 0, __pyx_float_0_);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_37, 1, __pyx_float_1_);
  __pyx_k__29 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __pyx_tuple__278 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_partials, __pyx_n_s_kind, __pyx_n_s_xcoeffs, __pyx_n_s_ycoeffs); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);
/* … */
  __pyx_t_37 = PyList_New(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_0_);
  __Pyx_GIVEREF(__pyx_float_0_);
  PyList_SET_ITEM(__pyx_t_37, 0, __pyx_float_0_);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_37, 1, __pyx_float_1_);
/* … */
  __pyx_t_40 = PyTuple_New(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_37);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_40, 1, __pyx_t_41);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_40, 2, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_40, 3, Py_None);
  __pyx_t_37 = 0;
  __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2061, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_kind, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2061, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_195make_polywave, 0, __pyx_n_s_make_polywave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_polywave, __pyx_t_37) < 0) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_polywave, 2061, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 2061, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_polywave {
  int __pyx_n;
  PyObject *partials;
  PyObject *kind;
  PyObject *xcoeffs;
  PyObject *ycoeffs;
};
+2062:                     kind: Optional[int]=Polynomial.FIRST_KIND,
  __pyx_t_37 = __Pyx_Enum_Polynomial_to_py(__pyx_e_8pysndlib_3clm_FIRST_KIND); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_k__30 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __pyx_t_41 = __Pyx_Enum_Polynomial_to_py(__pyx_e_8pysndlib_3clm_FIRST_KIND); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
+2063:                     xcoeffs = None,
  PyObject *__pyx_v_xcoeffs = ((PyObject *)Py_None);
/* … */
    values[3] = ((PyObject *)Py_None);
+2064:                     ycoeffs = None):
  PyObject *__pyx_v_ycoeffs = ((PyObject *)Py_None);
  __Pyx_memviewslice __pyx_v_xcoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_ycoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_prtls_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  PyObject *__pyx_v_prtls = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_polywave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_partials = __pyx_optional_args->partials;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kind = __pyx_optional_args->kind;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_xcoeffs = __pyx_optional_args->xcoeffs;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_ycoeffs = __pyx_optional_args->ycoeffs;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_xcoeffs);
  __Pyx_INCREF(__pyx_v_ycoeffs);
/* … */
    values[4] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partials);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kind);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xcoeffs);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ycoeffs);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_polywave") < 0)) __PYX_ERR(0, 2061, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
    __pyx_v_partials = values[1];
    __pyx_v_kind = values[2];
    __pyx_v_xcoeffs = values[3];
    __pyx_v_ycoeffs = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_polywave", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 2061, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_194make_polywave(__pyx_self, __pyx_v_frequency, __pyx_v_partials, __pyx_v_kind, __pyx_v_xcoeffs, __pyx_v_ycoeffs);
 2065:     """
 2066:     return a new polynomial-based waveshaping generator. make_polywave(440.0, partials=[1.0,1.0]) is
 2067:     the same \in effect as make_oscil.
 2068:     
 2069:     :param frequency: polywave frequency
 2070:     :param partials: a list of harmonic numbers and their associated amplitudes
 2071:     :param kind: Chebyshev polynomial choice
 2072:     :param xcoeffs: tn for tu-sum case
 2073:     :param ycoeffs: un for tu-sum case
 2074:     :return: polywave gen
 2075:     :rtype: mus_any
 2076:     """
 2077: 
+2078:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2079: 
+2080:     cdef double [:] xcoeffs_view = None
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __pyx_v_xcoeffs_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
+2081:     cdef double [:] ycoeffs_view = None
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __pyx_v_ycoeffs_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
+2082:     cdef double [:] prtls_view = None
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __pyx_v_prtls_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 2083: 
+2084:     if(isinstance(xcoeffs, np.ndarray | list) ) and (isinstance(ycoeffs, np.ndarray | list)): # should check they are same length
  __pyx_t_1 = PyNumber_Or(((PyObject *)__pyx_ptype_5numpy_ndarray), ((PyObject *)(&PyList_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_xcoeffs, __pyx_t_1); 
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyNumber_Or(((PyObject *)__pyx_ptype_5numpy_ndarray), ((PyObject *)(&PyList_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_ycoeffs, __pyx_t_1); 
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_9) {
/* … */
  }
+2085:         xcoeffs = np.array(xcoeffs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_xcoeffs);
    __Pyx_GIVEREF(__pyx_v_xcoeffs);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xcoeffs);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_xcoeffs, __pyx_t_6);
    __pyx_t_6 = 0;
+2086:         xcoeffs_view = xcoeffs
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_xcoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2086, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_xcoeffs_view, 1);
    __pyx_v_xcoeffs_view = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;
+2087:         ycoeffs = np.array(ycoeffs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_ycoeffs);
    __Pyx_GIVEREF(__pyx_v_ycoeffs);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ycoeffs);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_ycoeffs, __pyx_t_3);
    __pyx_t_3 = 0;
+2088:         ycoeffs_view = ycoeffs
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_ycoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2088, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_ycoeffs_view, 1);
    __pyx_v_ycoeffs_view = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;
+2089:         check_ndim(xcoeffs)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_xcoeffs};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2089, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2090:         check_ndim(ycoeffs)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_ycoeffs};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2090, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2091:         compare_shapes(xcoeffs, ycoeffs)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compare_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_xcoeffs, __pyx_v_ycoeffs};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 2092: 
+2093:         gen = mus_any.from_ptr(cclm.mus_make_polywave_tu(frequency,&xcoeffs_view[0],&ycoeffs_view[0], len(xcoeffs)))
    __pyx_t_11 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_v_xcoeffs_view.shape[0];
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_v_xcoeffs_view.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(0, 2093, __pyx_L1_error)
    }
    __pyx_t_12 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_v_ycoeffs_view.shape[0];
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_v_ycoeffs_view.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(0, 2093, __pyx_L1_error)
    }
    __pyx_t_13 = PyObject_Length(__pyx_v_xcoeffs); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2093, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_polywave_tu(__pyx_v_frequency, (&(*((double *) ( /* dim=0 */ (__pyx_v_xcoeffs_view.data + __pyx_t_11 * __pyx_v_xcoeffs_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_ycoeffs_view.data + __pyx_t_12 * __pyx_v_ycoeffs_view.strides[0]) )))), __pyx_t_13), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
    __pyx_t_3 = 0;
+2094:         gen.cache_extend([xcoeffs, ycoeffs])
    __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_xcoeffs);
    __Pyx_GIVEREF(__pyx_v_xcoeffs);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_xcoeffs);
    __Pyx_INCREF(__pyx_v_ycoeffs);
    __Pyx_GIVEREF(__pyx_v_ycoeffs);
    PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_ycoeffs);
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2095:         return gen
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_gen);
    __pyx_r = __pyx_v_gen;
    goto __pyx_L0;
 2096:     else:
+2097:         prtls = to_partials(partials)
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_to_partials(__pyx_v_partials, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_prtls = __pyx_t_1;
    __pyx_t_1 = 0;
 2098: 
+2099:         prtls = np.array(prtls, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_prtls);
    __Pyx_GIVEREF(__pyx_v_prtls);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prtls);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_prtls, __pyx_t_2);
    __pyx_t_2 = 0;
+2100:         prtls_view = prtls
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_prtls, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2100, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_prtls_view, 1);
    __pyx_v_prtls_view = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;
 2101: 
+2102:         check_ndim(prtls)
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_prtls};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 2103: 
+2104:         gen = mus_any.from_ptr(cclm.mus_make_polywave(frequency, &prtls_view[0], len(prtls), kind))
    __pyx_t_12 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_v_prtls_view.shape[0];
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_v_prtls_view.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(0, 2104, __pyx_L1_error)
    }
    __pyx_t_13 = PyObject_Length(__pyx_v_prtls); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2104, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_kind); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_polywave(__pyx_v_frequency, (&(*((double *) ( /* dim=0 */ (__pyx_v_prtls_view.data + __pyx_t_12 * __pyx_v_prtls_view.strides[0]) )))), __pyx_t_13, __pyx_t_7), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
+2105:         gen.cache_extend([prtls, xcoeffs, ycoeffs])
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_prtls);
    __Pyx_GIVEREF(__pyx_v_prtls);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_prtls);
    __Pyx_INCREF(__pyx_v_xcoeffs);
    __Pyx_GIVEREF(__pyx_v_xcoeffs);
    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_xcoeffs);
    __Pyx_INCREF(__pyx_v_ycoeffs);
    __Pyx_GIVEREF(__pyx_v_ycoeffs);
    PyList_SET_ITEM(__pyx_t_2, 2, __pyx_v_ycoeffs);
    __pyx_t_6 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+2106:         return gen
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_gen);
    __pyx_r = __pyx_v_gen;
    goto __pyx_L0;
  }
 2107: 
 2108: 
+2109: cpdef cython.double polywave(gen: mus_any, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_197polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_polywave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_polywave *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polywave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_197polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_196polywave, "\n    next sample of polywave waveshaper.\n    \n    :param gen: polywave gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_197polywave = {"polywave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_197polywave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_196polywave};
static PyObject *__pyx_pw_8pysndlib_3clm_197polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polywave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polywave") < 0)) __PYX_ERR(0, 2109, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("polywave", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2109, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2109, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_196polywave(__pyx_self, __pyx_v_gen, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_196polywave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polywave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_polywave(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_197polywave, 0, __pyx_n_s_polywave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_polywave, __pyx_t_41) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_polywave, 2109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 2109, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_polywave {
  int __pyx_n;
  PyObject *fm;
};
 2110:     """
 2111:     next sample of polywave waveshaper.
 2112:     
 2113:     :param gen: polywave gen
 2114:     :param fm: fm input
 2115:     :rtype: float
 2116:     """
+2117:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2117, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2118:         return cclm.mus_polywave(gen._ptr, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L1_error)
    __pyx_r = mus_polywave(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 2119:     else:
+2120:         return cclm.mus_polywave_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_polywave_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 2121: 
+2122: cpdef bint is_polywave(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_199is_polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_polywave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polywave", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_199is_polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_198is_polywave, "\n    returns True if gen is a polywave.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_199is_polywave = {"is_polywave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_199is_polywave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_198is_polywave};
static PyObject *__pyx_pw_8pysndlib_3clm_199is_polywave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polywave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2122, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_polywave") < 0)) __PYX_ERR(0, 2122, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_polywave", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2122, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2122, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_198is_polywave(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_198is_polywave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polywave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_polywave(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2122, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_polywave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2122, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_199is_polywave, 0, __pyx_n_s_is_polywave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_polywave, __pyx_t_37) < 0) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_polywave, 2122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 2122, __pyx_L1_error)
 2123:     """
 2124:     returns True if gen is a polywave.
 2125:     
 2126:     :param gen: gen
 2127:     :rtype: bool
 2128:     """
+2129:     return cclm.mus_is_polywave(gen._ptr)
  __pyx_r = mus_is_polywave(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2130: 
 2131: 
 2132: 
 2133: # ---------------- polyshape ---------------- #
 2134: 
+2135: cpdef mus_any make_polyshape(frequency: float,
static PyObject *__pyx_pw_8pysndlib_3clm_201make_polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_polyshape(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_polyshape *__pyx_optional_args) {
  PyObject *__pyx_v_initial_phase = ((PyObject *)__pyx_float_0_0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_data_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_201make_polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_200make_polyshape, "\n    return a new polynomial-based waveshaping generator.\n    \n    :param frequency: frequency of gen \\in hz\n    :param initial_phase: initial phase of gen \\in radians\n    :param coeff: coefficients can be passed to polyshape\n    :param partials: a list of harmonic numbers and their associated amplitudes\n    :param kind: Chebyshev polynomial choice\n    :return: polyshape gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_201make_polyshape = {"make_polyshape", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_201make_polyshape, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_200make_polyshape};
static PyObject *__pyx_pw_8pysndlib_3clm_201make_polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_initial_phase = 0;
  PyObject *__pyx_v_coeffs = 0;
  PyObject *__pyx_v_partials = 0;
  PyObject *__pyx_v_kind = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_polyshape (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_initial_phase,&__pyx_n_s_coeffs,&__pyx_n_s_partials,&__pyx_n_s_kind,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_float_0_0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_200make_polyshape(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_initial_phase, PyObject *__pyx_v_coeffs, PyObject *__pyx_v_partials, PyObject *__pyx_v_kind) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_polyshape", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.initial_phase = __pyx_v_initial_phase;
  __pyx_t_2.coeffs = __pyx_v_coeffs;
  __pyx_t_2.partials = __pyx_v_partials;
  __pyx_t_2.kind = __pyx_v_kind;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_polyshape(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__282 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_initial_phase, __pyx_n_s_coeffs, __pyx_n_s_partials, __pyx_n_s_kind); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
/* … */
  __pyx_t_40 = PyTuple_New(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_float_0_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_40, 1, Py_None);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_40, 2, __pyx_t_37);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_40, 3, __pyx_t_41);
  __pyx_t_37 = 0;
  __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2135, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_initial_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2135, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_kind, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2135, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_201make_polyshape, 0, __pyx_n_s_make_polyshape, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_polyshape, __pyx_t_37) < 0) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_polyshape, 2135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 2135, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_polyshape {
  int __pyx_n;
  PyObject *initial_phase;
  PyObject *coeffs;
  PyObject *partials;
  PyObject *kind;
};
 2136:                     initial_phase: Optional[float]=0.0,
+2137:                     coeffs=None,
  PyObject *__pyx_v_coeffs = ((PyObject *)Py_None);
  PyObject *__pyx_v_partials = __pyx_k__31;
  PyObject *__pyx_v_kind = __pyx_k__32;
  PyObject *__pyx_v_data = NULL;
  __Pyx_memviewslice __pyx_v_data_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_polyshape", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_phase = __pyx_optional_args->initial_phase;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_coeffs = __pyx_optional_args->coeffs;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_partials = __pyx_optional_args->partials;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_kind = __pyx_optional_args->kind;
          }
        }
      }
    }
  }
/* … */
    values[2] = ((PyObject *)Py_None);
    values[3] = __pyx_k__31;
    values[4] = __pyx_k__32;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_phase);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coeffs);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_partials);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kind);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_polyshape") < 0)) __PYX_ERR(0, 2135, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_initial_phase = values[1];
    __pyx_v_coeffs = values[2];
    __pyx_v_partials = values[3];
    __pyx_v_kind = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_polyshape", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 2135, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_200make_polyshape(__pyx_self, __pyx_v_frequency, __pyx_v_initial_phase, __pyx_v_coeffs, __pyx_v_partials, __pyx_v_kind);
+2138:                     partials= [1.,1.],
  __pyx_t_37 = PyList_New(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_37, 0, __pyx_float_1_);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_37, 1, __pyx_float_1_);
  __pyx_k__31 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __pyx_t_37 = PyList_New(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_37, 0, __pyx_float_1_);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyList_SET_ITEM(__pyx_t_37, 1, __pyx_float_1_);
+2139:                     kind: Optional[int]=Polynomial.FIRST_KIND):
  __pyx_t_37 = __Pyx_Enum_Polynomial_to_py(__pyx_e_8pysndlib_3clm_FIRST_KIND); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_k__32 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
/* … */
  __pyx_t_41 = __Pyx_Enum_Polynomial_to_py(__pyx_e_8pysndlib_3clm_FIRST_KIND); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
 2140:                     
 2141:     """
 2142:     return a new polynomial-based waveshaping generator.
 2143:     
 2144:     :param frequency: frequency of gen \in hz
 2145:     :param initial_phase: initial phase of gen \in radians
 2146:     :param coeff: coefficients can be passed to polyshape
 2147:     :param partials: a list of harmonic numbers and their associated amplitudes
 2148:     :param kind: Chebyshev polynomial choice
 2149:     :return: polyshape gen
 2150:     :rtype: mus_any
 2151:     """
 2152: 
+2153:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2153, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2154: 
+2155:     if coeffs:
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_coeffs); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 2155, __pyx_L1_error)
  if (__pyx_t_8) {
/* … */
    goto __pyx_L3;
  }
+2156:         if isinstance(coeffs, list):
    __pyx_t_8 = PyList_Check(__pyx_v_coeffs); 
    if (__pyx_t_8) {
/* … */
      goto __pyx_L4;
    }
+2157:             data = np.array(coeffs, dtype=np.double)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_coeffs);
      __Pyx_GIVEREF(__pyx_v_coeffs);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_coeffs);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_data = __pyx_t_6;
      __pyx_t_6 = 0;
 2158:         else:
+2159:             data = coeffs
    /*else*/ {
      __Pyx_INCREF(__pyx_v_coeffs);
      __pyx_v_data = __pyx_v_coeffs;
    }
    __pyx_L4:;
 2160: 
 2161:     else:
+2162:         data = partials2polynomial(partials, kind)
  /*else*/ {
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.kind = __pyx_v_kind;
    __pyx_t_6 = ((PyObject *)__pyx_f_8pysndlib_3clm_partials2polynomial(__pyx_v_partials, 0, &__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_data = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L3:;
 2163: 
+2164:     check_ndim(data)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_data};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 2165: 
+2166:     cdef double [:] data_view = data
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 2166, __pyx_L1_error)
  __pyx_v_data_view = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;
 2167: 
+2168:     gen = mus_any.from_ptr(cclm.mus_make_polyshape(frequency, initial_phase, &data_view[0], len(data), kind))
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_initial_phase); if (unlikely((__pyx_t_11 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L1_error)
  __pyx_t_12 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_data_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_data_view.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(0, 2168, __pyx_L1_error)
  }
  __pyx_t_13 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2168, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_kind); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L1_error)
  __pyx_t_6 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_polyshape(__pyx_v_frequency, __pyx_t_11, (&(*((double *) ( /* dim=0 */ (__pyx_v_data_view.data + __pyx_t_12 * __pyx_v_data_view.strides[0]) )))), __pyx_t_13, __pyx_t_7), NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_6);
  __pyx_t_6 = 0;
+2169:     gen.cache_append(data)
  __pyx_t_6 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_data, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+2170:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 2171: 
+2172: cpdef cython.double polyshape(gen: mus_any, index: Optional[float]=1.0, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_203polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_polyshape(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_polyshape *__pyx_optional_args) {
  PyObject *__pyx_v_index = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polyshape", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_index = __pyx_optional_args->index;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fm = __pyx_optional_args->fm;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_203polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_202polyshape, "\n    next sample of polynomial-based waveshaper.\n    \n    :param gen: polyshape gen\n    :param index: fm index\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_203polyshape = {"polyshape", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_203polyshape, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_202polyshape};
static PyObject *__pyx_pw_8pysndlib_3clm_203polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polyshape (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_index,&__pyx_n_s_fm,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "polyshape") < 0)) __PYX_ERR(0, 2172, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_index = values[1];
    __pyx_v_fm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("polyshape", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2172, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2172, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_202polyshape(__pyx_self, __pyx_v_gen, __pyx_v_index, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_202polyshape(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_index, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polyshape", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.index = __pyx_v_index;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_polyshape(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__284 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_index, __pyx_n_s_fm); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_polyshape, 2172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 2172, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_index, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_203polyshape, 0, __pyx_n_s_polyshape, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__286);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_polyshape, __pyx_t_41) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__286 = PyTuple_Pack(2, __pyx_float_1_0, Py_None); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_polyshape {
  int __pyx_n;
  PyObject *index;
  PyObject *fm;
};
 2173:     """
 2174:     next sample of polynomial-based waveshaper.
 2175:     
 2176:     :param gen: polyshape gen
 2177:     :param index: fm index
 2178:     :param fm: fm input
 2179:     :rtype: float
 2180:     """
+2181:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2181, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2182:         return cclm.mus_polyshape(gen._ptr, index, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_index); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L1_error)
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_3 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L1_error)
    __pyx_r = mus_polyshape(__pyx_v_gen->_ptr, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
 2183:     else:
+2184:         return cclm.mus_polyshape_unmodulated(gen._ptr, index)
  /*else*/ {
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_index); if (unlikely((__pyx_t_3 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2184, __pyx_L1_error)
    __pyx_r = mus_polyshape_unmodulated(__pyx_v_gen->_ptr, __pyx_t_3);
    goto __pyx_L0;
  }
 2185: 
+2186: cpdef bint is_polyshape(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_205is_polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_polyshape(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polyshape", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_205is_polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_204is_polyshape, "\n    returns True if gen is a polyshape.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_205is_polyshape = {"is_polyshape", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_205is_polyshape, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_204is_polyshape};
static PyObject *__pyx_pw_8pysndlib_3clm_205is_polyshape(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polyshape (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2186, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_polyshape") < 0)) __PYX_ERR(0, 2186, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_polyshape", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2186, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2186, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_204is_polyshape(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_204is_polyshape(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_polyshape", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_polyshape(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2186, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_polyshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2186, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_205is_polyshape, 0, __pyx_n_s_is_polyshape, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_polyshape, __pyx_t_37) < 0) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_polyshape, 2186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 2186, __pyx_L1_error)
 2187:     """
 2188:     returns True if gen is a polyshape.
 2189:     
 2190:     :param gen: gen
 2191:     :rtype: bool
 2192:     """
+2193:     return cclm.mus_is_polyshape(gen._ptr)
  __pyx_r = mus_is_polyshape(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2194: 
 2195: 
 2196: # ---------------- triangle-wave ---------------- #    
+2197: cpdef mus_any make_triangle_wave(frequency: float, amplitude: Optional[float]=1.0, phase: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_207make_triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_triangle_wave(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_triangle_wave *__pyx_optional_args) {
  PyObject *__pyx_v_amplitude = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_phase = ((PyObject *)__pyx_float_0_0);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_triangle_wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amplitude = __pyx_optional_args->amplitude;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_phase = __pyx_optional_args->phase;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_207make_triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_206make_triangle_wave, "\n    return a new triangle_wave generator.\n    \n    :param frequency: frequency of generator\n    :param amplitude: amplitude of generator\n    :param phase: initial phase\n    :return: triangle_wave gen\n    :rtype: mus_any\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_207make_triangle_wave = {"make_triangle_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_207make_triangle_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_206make_triangle_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_207make_triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_amplitude = 0;
  PyObject *__pyx_v_phase = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_triangle_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_amplitude,&__pyx_n_s_phase,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amplitude);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phase);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_triangle_wave") < 0)) __PYX_ERR(0, 2197, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L3_error)
    __pyx_v_amplitude = values[1];
    __pyx_v_phase = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_triangle_wave", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2197, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_206make_triangle_wave(__pyx_self, __pyx_v_frequency, __pyx_v_amplitude, __pyx_v_phase);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_206make_triangle_wave(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_phase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_triangle_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.amplitude = __pyx_v_amplitude;
  __pyx_t_2.phase = __pyx_v_phase;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_triangle_wave(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__288 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_amplitude, __pyx_n_s_phase); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);
  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_triangle_wave, 2197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 2197, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_amplitude, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2197, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_207make_triangle_wave, 0, __pyx_n_s_make_triangle_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__290);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_triangle_wave, __pyx_t_41) < 0) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__290 = PyTuple_Pack(2, __pyx_float_1_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_triangle_wave {
  int __pyx_n;
  PyObject *amplitude;
  PyObject *phase;
};
 2198:     """
 2199:     return a new triangle_wave generator.
 2200:     
 2201:     :param frequency: frequency of generator
 2202:     :param amplitude: amplitude of generator
 2203:     :param phase: initial phase
 2204:     :return: triangle_wave gen
 2205:     :rtype: mus_any
 2206:     
 2207:     """
+2208:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2209: 
+2210:     return mus_any.from_ptr(cclm.mus_make_triangle_wave(frequency, amplitude, phase))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_amplitude); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_triangle_wave(__pyx_v_frequency, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2211: 
+2212: cpdef cython.double triangle_wave(gen: mus_any, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_209triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_triangle_wave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_triangle_wave *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangle_wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_209triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_208triangle_wave, "\n    next triangle wave sample from generator  .\n    \n    :param gen: polyshape gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_209triangle_wave = {"triangle_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_209triangle_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_208triangle_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_209triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangle_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "triangle_wave") < 0)) __PYX_ERR(0, 2212, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("triangle_wave", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2212, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2212, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_208triangle_wave(__pyx_self, __pyx_v_gen, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_208triangle_wave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("triangle_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_triangle_wave(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2212, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_209triangle_wave, 0, __pyx_n_s_triangle_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangle_wave, __pyx_t_37) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_triangle_wave, 2212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 2212, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_triangle_wave {
  int __pyx_n;
  PyObject *fm;
};
 2213:     """
 2214:     next triangle wave sample from generator  .
 2215:     
 2216:     :param gen: polyshape gen
 2217:     :param fm: fm input
 2218:     :rtype: float
 2219:     """
+2220:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2220, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2221:         return cclm.mus_triangle_wave(gen._ptr, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2221, __pyx_L1_error)
    __pyx_r = mus_triangle_wave(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 2222:     else:
+2223:         return cclm.mus_triangle_wave_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_triangle_wave_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 2224: 
+2225: cpdef bint is_triangle_wave(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_211is_triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_triangle_wave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_triangle_wave", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_211is_triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_210is_triangle_wave, "\n    returns True if gen is a triangle_wave.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_211is_triangle_wave = {"is_triangle_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_211is_triangle_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_210is_triangle_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_211is_triangle_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_triangle_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2225, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_triangle_wave") < 0)) __PYX_ERR(0, 2225, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_triangle_wave", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2225, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2225, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_210is_triangle_wave(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_210is_triangle_wave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_triangle_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_triangle_wave(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2225, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_triangle_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2225, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_211is_triangle_wave, 0, __pyx_n_s_is_triangle_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_triangle_wave, __pyx_t_41) < 0) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_triangle_wave, 2225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 2225, __pyx_L1_error)
 2226:     """
 2227:     returns True if gen is a triangle_wave.
 2228:     
 2229:     :param gen: gen
 2230:     :rtype: bool
 2231:     """
+2232:     return cclm.mus_is_triangle_wave(gen._ptr)
  __pyx_r = mus_is_triangle_wave(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2233: 
 2234: # ---------------- square-wave ---------------- #    
+2235: cpdef mus_any make_square_wave(frequency: float, amplitude: Optional[float]=1.0, phase: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_213make_square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_square_wave(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_square_wave *__pyx_optional_args) {
  PyObject *__pyx_v_amplitude = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_phase = ((PyObject *)__pyx_float_0_0);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_square_wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amplitude = __pyx_optional_args->amplitude;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_phase = __pyx_optional_args->phase;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_213make_square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_212make_square_wave, "\n    return a new square_wave generator.\n    \n    :param frequency: frequency of generator\n    :param amplitude: amplitude of generator\n    :param phase: initial phase\n    :return: square_wave gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_213make_square_wave = {"make_square_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_213make_square_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_212make_square_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_213make_square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_amplitude = 0;
  PyObject *__pyx_v_phase = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_square_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_amplitude,&__pyx_n_s_phase,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2235, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amplitude);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phase);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2235, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_square_wave") < 0)) __PYX_ERR(0, 2235, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2235, __pyx_L3_error)
    __pyx_v_amplitude = values[1];
    __pyx_v_phase = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_square_wave", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2235, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_212make_square_wave(__pyx_self, __pyx_v_frequency, __pyx_v_amplitude, __pyx_v_phase);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_212make_square_wave(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_phase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_square_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.amplitude = __pyx_v_amplitude;
  __pyx_t_2.phase = __pyx_v_phase;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_square_wave(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_square_wave, 2235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 2235, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2235, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_amplitude, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2235, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2235, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_213make_square_wave, 0, __pyx_n_s_make_square_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__294);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_square_wave, __pyx_t_37) < 0) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__294 = PyTuple_Pack(2, __pyx_float_1_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__294);
  __Pyx_GIVEREF(__pyx_tuple__294);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_square_wave {
  int __pyx_n;
  PyObject *amplitude;
  PyObject *phase;
};
 2236:     """
 2237:     return a new square_wave generator.
 2238:     
 2239:     :param frequency: frequency of generator
 2240:     :param amplitude: amplitude of generator
 2241:     :param phase: initial phase
 2242:     :return: square_wave gen
 2243:     :rtype: mus_any
 2244:     """
+2245:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2246: 
+2247:     return mus_any.from_ptr(cclm.mus_make_square_wave(frequency, amplitude, phase))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_amplitude); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2247, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2247, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_square_wave(__pyx_v_frequency, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2248: 
+2249: cpdef cython.double square_wave(gen: mus_any, fm: cython.double=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_215square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_square_wave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_square_wave *__pyx_optional_args) {
  double __pyx_v_fm = ((double)0.0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("square_wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_215square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_214square_wave, "\n    next square wave sample from generator.\n    \n    :param gen: polyshape gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_215square_wave = {"square_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_215square_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_214square_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_215square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_fm;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("square_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2249, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2249, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "square_wave") < 0)) __PYX_ERR(0, 2249, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    if (values[1]) {
      __pyx_v_fm = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fm == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2249, __pyx_L3_error)
    } else {
      __pyx_v_fm = ((double)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("square_wave", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2249, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2249, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_214square_wave(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_214square_wave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("square_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_square_wave(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2249, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_square_wave, 2249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(0, 2249, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2249, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 2249, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_215square_wave, 0, __pyx_n_s_square_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__296);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_square_wave, __pyx_t_41) < 0) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__296 = PyTuple_Pack(1, __pyx_float_0_0); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__296);
  __Pyx_GIVEREF(__pyx_tuple__296);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_square_wave {
  int __pyx_n;
  double fm;
};
 2250:     """
 2251:     next square wave sample from generator.
 2252:     
 2253:     :param gen: polyshape gen
 2254:     :param fm: fm input
 2255:     :rtype: float
 2256:     """
+2257:     return cclm.mus_square_wave(gen._ptr, fm)
  __pyx_r = mus_square_wave(__pyx_v_gen->_ptr, __pyx_v_fm);
  goto __pyx_L0;
 2258: 
+2259: cpdef bint is_square_wave(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_217is_square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_square_wave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_square_wave", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_217is_square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_216is_square_wave, "\n    returns True if gen is a square_wave.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_217is_square_wave = {"is_square_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_217is_square_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_216is_square_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_217is_square_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_square_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2259, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_square_wave") < 0)) __PYX_ERR(0, 2259, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_square_wave", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2259, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2259, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_216is_square_wave(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_216is_square_wave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_square_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_square_wave(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2259, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_square_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2259, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_217is_square_wave, 0, __pyx_n_s_is_square_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_square_wave, __pyx_t_37) < 0) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_square_wave, 2259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2259, __pyx_L1_error)
 2260:     """
 2261:     returns True if gen is a square_wave.
 2262:     
 2263:     :param gen: gen
 2264:     :rtype: bool
 2265:     """
+2266:     return cclm.mus_is_square_wave(gen._ptr)
  __pyx_r = mus_is_square_wave(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2267: 
 2268: # ---------------- sawtooth-wave ---------------- #    
+2269: cpdef mus_any make_sawtooth_wave(frequency: float, amplitude: Optional[float]=1.0, phase: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_219make_sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_sawtooth_wave(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_sawtooth_wave *__pyx_optional_args) {
  PyObject *__pyx_v_amplitude = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_phase = ((PyObject *)__pyx_float_0_0);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_sawtooth_wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amplitude = __pyx_optional_args->amplitude;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_phase = __pyx_optional_args->phase;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_219make_sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_218make_sawtooth_wave, "\n    return a new sawtooth_wave generator.\n    \n    :param frequency: frequency of generator\n    :param amplitude: amplitude of generator\n    :param phase: initial phase\n    :return: sawtooth_wave gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_219make_sawtooth_wave = {"make_sawtooth_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_219make_sawtooth_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_218make_sawtooth_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_219make_sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_amplitude = 0;
  PyObject *__pyx_v_phase = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_sawtooth_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_amplitude,&__pyx_n_s_phase,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amplitude);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phase);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_sawtooth_wave") < 0)) __PYX_ERR(0, 2269, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
    __pyx_v_amplitude = values[1];
    __pyx_v_phase = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_sawtooth_wave", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2269, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_218make_sawtooth_wave(__pyx_self, __pyx_v_frequency, __pyx_v_amplitude, __pyx_v_phase);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_218make_sawtooth_wave(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_phase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_sawtooth_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.amplitude = __pyx_v_amplitude;
  __pyx_t_2.phase = __pyx_v_phase;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_sawtooth_wave(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_sawtooth_wave, 2269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 2269, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_amplitude, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2269, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_219make_sawtooth_wave, 0, __pyx_n_s_make_sawtooth_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__299);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_sawtooth_wave, __pyx_t_41) < 0) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__299 = PyTuple_Pack(2, __pyx_float_1_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_sawtooth_wave {
  int __pyx_n;
  PyObject *amplitude;
  PyObject *phase;
};
 2270:     """
 2271:     return a new sawtooth_wave generator.
 2272:     
 2273:     :param frequency: frequency of generator
 2274:     :param amplitude: amplitude of generator
 2275:     :param phase: initial phase
 2276:     :return: sawtooth_wave gen
 2277:     :rtype: mus_any
 2278:     """
 2279: 
+2280:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2281: 
+2282:     return mus_any.from_ptr(cclm.mus_make_sawtooth_wave(frequency, amplitude, phase))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_amplitude); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2282, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2282, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_sawtooth_wave(__pyx_v_frequency, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2283: 
+2284: cpdef cython.double sawtooth_wave(gen: mus_any, fm: cython.double=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_221sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_sawtooth_wave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_sawtooth_wave *__pyx_optional_args) {
  double __pyx_v_fm = ((double)0.0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sawtooth_wave", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_221sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_220sawtooth_wave, "\n    next sawtooth wave sample from generator.\n    \n    :param gen: polyshape gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_221sawtooth_wave = {"sawtooth_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_221sawtooth_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_220sawtooth_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_221sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_fm;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sawtooth_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2284, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2284, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sawtooth_wave") < 0)) __PYX_ERR(0, 2284, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    if (values[1]) {
      __pyx_v_fm = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fm == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2284, __pyx_L3_error)
    } else {
      __pyx_v_fm = ((double)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sawtooth_wave", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2284, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2284, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_220sawtooth_wave(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_220sawtooth_wave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sawtooth_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_sawtooth_wave(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2284, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_sawtooth_wave, 2284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 2284, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2284, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 2284, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_221sawtooth_wave, 0, __pyx_n_s_sawtooth_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__301);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sawtooth_wave, __pyx_t_37) < 0) __PYX_ERR(0, 2284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__301 = PyTuple_Pack(1, __pyx_float_0_0); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_sawtooth_wave {
  int __pyx_n;
  double fm;
};
 2285:     """
 2286:     next sawtooth wave sample from generator.
 2287:     
 2288:     :param gen: polyshape gen
 2289:     :param fm: fm input
 2290:     :rtype: float
 2291:     """
+2292:     return cclm.mus_sawtooth_wave(gen._ptr, fm)
  __pyx_r = mus_sawtooth_wave(__pyx_v_gen->_ptr, __pyx_v_fm);
  goto __pyx_L0;
 2293: 
 2294: 
+2295: cpdef bint is_sawtooth_wave(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_223is_sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_sawtooth_wave(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sawtooth_wave", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_223is_sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_222is_sawtooth_wave, "\n    returns True if gen is a sawtooth_wave.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_223is_sawtooth_wave = {"is_sawtooth_wave", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_223is_sawtooth_wave, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_222is_sawtooth_wave};
static PyObject *__pyx_pw_8pysndlib_3clm_223is_sawtooth_wave(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sawtooth_wave (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2295, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_sawtooth_wave") < 0)) __PYX_ERR(0, 2295, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_sawtooth_wave", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2295, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2295, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_222is_sawtooth_wave(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_222is_sawtooth_wave(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sawtooth_wave", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_sawtooth_wave(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2295, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_sawtooth_wave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2295, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_223is_sawtooth_wave, 0, __pyx_n_s_is_sawtooth_wave, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__302)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_sawtooth_wave, __pyx_t_41) < 0) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_sawtooth_wave, 2295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(0, 2295, __pyx_L1_error)
 2296:     """
 2297:     returns True if gen is a sawtooth_wave.
 2298:     
 2299:     :param gen: gen
 2300:     :rtype: bool
 2301:     """
+2302:     return cclm.mus_is_sawtooth_wave(gen._ptr)
  __pyx_r = mus_is_sawtooth_wave(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2303: 
 2304: # ---------------- pulse-train ---------------- #        
+2305: cpdef mus_any make_pulse_train(frequency: float, amplitude: Optional[float]=1.0, phase: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_225make_pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_pulse_train(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_pulse_train *__pyx_optional_args) {
  PyObject *__pyx_v_amplitude = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_phase = ((PyObject *)__pyx_float_0_0);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pulse_train", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amplitude = __pyx_optional_args->amplitude;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_phase = __pyx_optional_args->phase;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_225make_pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_224make_pulse_train, "\n    return a new pulse_train generator. this produces a sequence of impulses.\n    \n    :param frequency: frequency of generator\n    :param amplitude: amplitude of generator\n    :param phase: initial phase\n    :return: pulse_train gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_225make_pulse_train = {"make_pulse_train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_225make_pulse_train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_224make_pulse_train};
static PyObject *__pyx_pw_8pysndlib_3clm_225make_pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_amplitude = 0;
  PyObject *__pyx_v_phase = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pulse_train (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_amplitude,&__pyx_n_s_phase,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amplitude);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phase);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_pulse_train") < 0)) __PYX_ERR(0, 2305, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
    __pyx_v_amplitude = values[1];
    __pyx_v_phase = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_pulse_train", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2305, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_224make_pulse_train(__pyx_self, __pyx_v_frequency, __pyx_v_amplitude, __pyx_v_phase);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_224make_pulse_train(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_phase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pulse_train", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.amplitude = __pyx_v_amplitude;
  __pyx_t_2.phase = __pyx_v_phase;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_pulse_train(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_pulse_train, 2305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2305, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_amplitude, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_225make_pulse_train, 0, __pyx_n_s_make_pulse_train, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__304);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_pulse_train, __pyx_t_37) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__304 = PyTuple_Pack(2, __pyx_float_1_0, __pyx_float_0_0); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_pulse_train {
  int __pyx_n;
  PyObject *amplitude;
  PyObject *phase;
};
 2306:     """
 2307:     return a new pulse_train generator. this produces a sequence of impulses.
 2308:     
 2309:     :param frequency: frequency of generator
 2310:     :param amplitude: amplitude of generator
 2311:     :param phase: initial phase
 2312:     :return: pulse_train gen
 2313:     :rtype: mus_any
 2314:     """
 2315: 
+2316:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2316, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2317: 
+2318:     return mus_any.from_ptr(cclm.mus_make_pulse_train(frequency, amplitude, phase))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_amplitude); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2318, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2318, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_pulse_train(__pyx_v_frequency, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2319: 
+2320: cpdef cython.double pulse_train(gen: mus_any, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_227pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_pulse_train(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_pulse_train *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pulse_train", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_227pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_226pulse_train, "\n    next pulse train sample from generator.\n    \n    :param gen: pulse_train gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_227pulse_train = {"pulse_train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_227pulse_train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_226pulse_train};
static PyObject *__pyx_pw_8pysndlib_3clm_227pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pulse_train (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pulse_train") < 0)) __PYX_ERR(0, 2320, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pulse_train", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2320, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2320, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_226pulse_train(__pyx_self, __pyx_v_gen, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_226pulse_train(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pulse_train", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_pulse_train(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2320, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2320, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_227pulse_train, 0, __pyx_n_s_pulse_train, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pulse_train, __pyx_t_41) < 0) __PYX_ERR(0, 2320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_pulse_train, 2320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(0, 2320, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_pulse_train {
  int __pyx_n;
  PyObject *fm;
};
 2321:     """
 2322:     next pulse train sample from generator.
 2323:     
 2324:     :param gen: pulse_train gen
 2325:     :param fm: fm input
 2326:     :rtype: float
 2327:     """
+2328:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2328, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2329:         return cclm.mus_pulse_train(gen._ptr, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2329, __pyx_L1_error)
    __pyx_r = mus_pulse_train(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 2330:     else:
+2331:         return cclm.mus_pulse_train_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_pulse_train_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 2332: 
+2333: cpdef bint is_pulse_train(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_229is_pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_pulse_train(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pulse_train", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_229is_pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_228is_pulse_train, "\n    returns True if gen is a pulse_train.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_229is_pulse_train = {"is_pulse_train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_229is_pulse_train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_228is_pulse_train};
static PyObject *__pyx_pw_8pysndlib_3clm_229is_pulse_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pulse_train (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2333, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_pulse_train") < 0)) __PYX_ERR(0, 2333, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_pulse_train", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2333, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2333, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_228is_pulse_train(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_228is_pulse_train(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pulse_train", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_pulse_train(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2333, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_pulse_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2333, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_229is_pulse_train, 0, __pyx_n_s_is_pulse_train, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__306)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_pulse_train, __pyx_t_37) < 0) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_pulse_train, 2333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 2333, __pyx_L1_error)
 2334:     """
 2335:     returns True if gen is a pulse_train.
 2336:     
 2337:     :param gen: gen
 2338:     :rtype: bool
 2339:     """
+2340:     return cclm.mus_is_pulse_train(gen._ptr)
  __pyx_r = mus_is_pulse_train(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2341: 
 2342: # ---------------- ncos ---------------- #
 2343: 
+2344: cpdef mus_any make_ncos(frequency: float, n: Optional[int]=1):
static PyObject *__pyx_pw_8pysndlib_3clm_231make_ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_ncos(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_ncos *__pyx_optional_args) {
  PyObject *__pyx_v_n = ((PyObject *)__pyx_int_1);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_ncos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_n = __pyx_optional_args->n;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_231make_ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_230make_ncos, "\n    return a new ncos generator, producing a sum of 'n' equal amplitude cosines.\n    \n    :param frequency: frequency of generator\n    :param n: number of cosines\n    :return: ncos gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_231make_ncos = {"make_ncos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_231make_ncos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_230make_ncos};
static PyObject *__pyx_pw_8pysndlib_3clm_231make_ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_n = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_ncos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_1);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2344, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2344, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_ncos") < 0)) __PYX_ERR(0, 2344, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2344, __pyx_L3_error)
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_ncos", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2344, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_230make_ncos(__pyx_self, __pyx_v_frequency, __pyx_v_n);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_230make_ncos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_ncos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.n = __pyx_v_n;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_ncos(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__307 = PyTuple_Pack(2, __pyx_n_s_frequency, __pyx_n_s_n); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_ncos, 2344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 2344, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_n, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2344, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_231make_ncos, 0, __pyx_n_s_make_ncos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__309);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_ncos, __pyx_t_41) < 0) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__309 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_ncos {
  int __pyx_n;
  PyObject *n;
};
 2345:     """
 2346:     return a new ncos generator, producing a sum of 'n' equal amplitude cosines.
 2347:     
 2348:     :param frequency: frequency of generator
 2349:     :param n: number of cosines
 2350:     :return: ncos gen
 2351:     :rtype: mus_any
 2352:     """
 2353: 
+2354:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2354, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2355:     check_range('n', n, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_n, __pyx_v_n, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2356: 
 2357: 
+2358:     return mus_any.from_ptr(cclm.mus_make_ncos(frequency, n))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2358, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_ncos(__pyx_v_frequency, __pyx_t_7), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2359: 
+2360: cpdef cython.double ncos(gen: mus_any, fm: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_233ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_ncos(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_ncos *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)__pyx_float_0_0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ncos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_233ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_232ncos, "\n    get the next sample from 'gen', an ncos generator.\n    \n    :param gen: ncos gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_233ncos = {"ncos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_233ncos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_232ncos};
static PyObject *__pyx_pw_8pysndlib_3clm_233ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ncos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2360, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2360, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ncos") < 0)) __PYX_ERR(0, 2360, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ncos", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2360, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_232ncos(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_232ncos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ncos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_ncos(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2360, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_ncos, 2360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 2360, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2360, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2360, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_233ncos, 0, __pyx_n_s_ncos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__311);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ncos, __pyx_t_37) < 0) __PYX_ERR(0, 2360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__311 = PyTuple_Pack(1, __pyx_float_0_0); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_ncos {
  int __pyx_n;
  PyObject *fm;
};
 2361:     """
 2362:     get the next sample from 'gen', an ncos generator.
 2363:     
 2364:     :param gen: ncos gen
 2365:     :param fm: fm input
 2366:     :rtype: float
 2367:     """
+2368:     return cclm.mus_ncos(gen._ptr, fm)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2368, __pyx_L1_error)
  __pyx_r = mus_ncos(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 2369: 
+2370: cpdef bint is_ncos(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_235is_ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_ncos(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ncos", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_235is_ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_234is_ncos, "\n    returns True if gen is a ncos.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_235is_ncos = {"is_ncos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_235is_ncos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_234is_ncos};
static PyObject *__pyx_pw_8pysndlib_3clm_235is_ncos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ncos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2370, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_ncos") < 0)) __PYX_ERR(0, 2370, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_ncos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2370, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2370, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_234is_ncos(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_234is_ncos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ncos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_ncos(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2370, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_ncos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2370, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_235is_ncos, 0, __pyx_n_s_is_ncos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_ncos, __pyx_t_41) < 0) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_ncos, 2370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 2370, __pyx_L1_error)
 2371:     """
 2372:     returns True if gen is a ncos.
 2373:     
 2374:     :param gen: gen
 2375:     :rtype: bool
 2376:     """
+2377:     return cclm.mus_is_ncos(gen._ptr)
  __pyx_r = mus_is_ncos(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2378: 
 2379: 
 2380: # ---------------- nsin ---------------- #
+2381: cpdef mus_any make_nsin(frequency: float, n: Optional[int]=1):
static PyObject *__pyx_pw_8pysndlib_3clm_237make_nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_nsin(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_nsin *__pyx_optional_args) {
  PyObject *__pyx_v_n = ((PyObject *)__pyx_int_1);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nsin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_n = __pyx_optional_args->n;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_237make_nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_236make_nsin, "\n    return a new nsin generator, producing a sum of 'n' equal amplitude sines.\n    \n    :param frequency: frequency of generator\n    :param n: number of sines\n    :return: nsin gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_237make_nsin = {"make_nsin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_237make_nsin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_236make_nsin};
static PyObject *__pyx_pw_8pysndlib_3clm_237make_nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_n = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nsin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_1);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_nsin") < 0)) __PYX_ERR(0, 2381, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_nsin", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2381, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_236make_nsin(__pyx_self, __pyx_v_frequency, __pyx_v_n);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_236make_nsin(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nsin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.n = __pyx_v_n;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_nsin(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2381, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_n, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2381, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_237make_nsin, 0, __pyx_n_s_make_nsin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__309);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_nsin, __pyx_t_37) < 0) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_nsin, 2381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 2381, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_nsin {
  int __pyx_n;
  PyObject *n;
};
 2382:     """
 2383:     return a new nsin generator, producing a sum of 'n' equal amplitude sines.
 2384:     
 2385:     :param frequency: frequency of generator
 2386:     :param n: number of sines
 2387:     :return: nsin gen
 2388:     :rtype: mus_any
 2389:     """
 2390: 
+2391:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2391, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2392:     check_range('n', n, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_n, __pyx_v_n, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2393: 
+2394:     return mus_any.from_ptr(cclm.mus_make_nsin(frequency, n))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_nsin(__pyx_v_frequency, __pyx_t_7), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2395: 
+2396: cpdef cython.double nsin(gen: mus_any, fm: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_239nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_nsin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_nsin *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)__pyx_float_0_0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nsin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_239nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_238nsin, "\n    get the next sample from 'gen', an nsin generator.\n    \n    :param gen: ncos gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_239nsin = {"nsin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_239nsin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_238nsin};
static PyObject *__pyx_pw_8pysndlib_3clm_239nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nsin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "nsin") < 0)) __PYX_ERR(0, 2396, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nsin", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2396, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2396, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_238nsin(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_238nsin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nsin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_nsin(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_nsin, 2396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(0, 2396, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2396, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2396, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_239nsin, 0, __pyx_n_s_nsin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__315);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nsin, __pyx_t_41) < 0) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__315 = PyTuple_Pack(1, __pyx_float_0_0); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_nsin {
  int __pyx_n;
  PyObject *fm;
};
 2397:     """
 2398:     get the next sample from 'gen', an nsin generator.
 2399:     
 2400:     :param gen: ncos gen
 2401:     :param fm: fm input
 2402:     :rtype: float
 2403:     """
+2404:     return cclm.mus_nsin(gen._ptr, fm)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2404, __pyx_L1_error)
  __pyx_r = mus_nsin(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 2405: 
+2406: cpdef bint is_nsin(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_241is_nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_nsin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nsin", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_241is_nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_240is_nsin, "\n    returns True if gen is a nsin.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_241is_nsin = {"is_nsin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_241is_nsin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_240is_nsin};
static PyObject *__pyx_pw_8pysndlib_3clm_241is_nsin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nsin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_nsin") < 0)) __PYX_ERR(0, 2406, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_nsin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2406, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2406, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_240is_nsin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_240is_nsin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nsin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_nsin(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_nsin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2406, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_241is_nsin, 0, __pyx_n_s_is_nsin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_nsin, __pyx_t_37) < 0) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_nsin, 2406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 2406, __pyx_L1_error)
 2407:     """
 2408:     returns True if gen is a nsin.
 2409:     
 2410:     :param gen: gen
 2411:     :rtype: bool
 2412:     """
+2413:     return cclm.mus_is_nsin(gen._ptr)
  __pyx_r = mus_is_nsin(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2414: 
 2415: # ---------------- nrxysin and nrxycos ---------------- #
 2416: 
+2417: cpdef mus_any make_nrxysin(frequency: float, ratio: Optional[float]=1., n: Optional[int]=1, r: Optional[float]=.5):
static PyObject *__pyx_pw_8pysndlib_3clm_243make_nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_nrxysin(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_nrxysin *__pyx_optional_args) {
  PyObject *__pyx_v_ratio = ((PyObject *)__pyx_float_1_);
  PyObject *__pyx_v_n = ((PyObject *)__pyx_int_1);
  PyObject *__pyx_v_r = ((PyObject *)__pyx_float__5);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nrxysin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ratio = __pyx_optional_args->ratio;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_n = __pyx_optional_args->n;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_r = __pyx_optional_args->r;
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_243make_nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_242make_nrxysin, "\n    return a new nrxysin generator.\n    \n    :param frequency: frequency of generator\n    :param ratio: ratio between frequency and the spacing between successive sidebands\n    :param n: number of sidebands\n    :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)\n    :return: nrxysin gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_243make_nrxysin = {"make_nrxysin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_243make_nrxysin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_242make_nrxysin};
static PyObject *__pyx_pw_8pysndlib_3clm_243make_nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_ratio = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_v_r = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nrxysin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_ratio,&__pyx_n_s_n,&__pyx_n_s_r,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_);
    values[2] = ((PyObject *)__pyx_int_1);
    values[3] = ((PyObject *)__pyx_float__5);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ratio);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_nrxysin") < 0)) __PYX_ERR(0, 2417, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L3_error)
    __pyx_v_ratio = values[1];
    __pyx_v_n = values[2];
    __pyx_v_r = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_nrxysin", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 2417, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_242make_nrxysin(__pyx_self, __pyx_v_frequency, __pyx_v_ratio, __pyx_v_n, __pyx_v_r);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_242make_nrxysin(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_ratio, PyObject *__pyx_v_n, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nrxysin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.ratio = __pyx_v_ratio;
  __pyx_t_2.n = __pyx_v_n;
  __pyx_t_2.r = __pyx_v_r;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_nrxysin(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__317 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_ratio, __pyx_n_s_n, __pyx_n_s_r); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_nrxysin, 2417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 2417, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_ratio, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_n, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_r, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_243make_nrxysin, 0, __pyx_n_s_make_nrxysin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__319);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_nrxysin, __pyx_t_41) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__319 = PyTuple_Pack(3, __pyx_float_1_, __pyx_int_1, __pyx_float__5); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_nrxysin {
  int __pyx_n;
  PyObject *ratio;
  PyObject *n;
  PyObject *r;
};
 2418:     """
 2419:     return a new nrxysin generator.
 2420:     
 2421:     :param frequency: frequency of generator
 2422:     :param ratio: ratio between frequency and the spacing between successive sidebands
 2423:     :param n: number of sidebands
 2424:     :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)
 2425:     :return: nrxysin gen
 2426:     :rtype: mus_any
 2427:     """
+2428:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2428, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2429:     check_range('r', r, -1.0, 1.0)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_r, __pyx_v_r, __pyx_float_neg_1_0, __pyx_float_1_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2430:     check_range('n', n, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_n, __pyx_v_n, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2431: 
+2432:     return mus_any.from_ptr(cclm.mus_make_nrxysin(frequency, ratio, n, r))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_ratio); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_r); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_nrxysin(__pyx_v_frequency, __pyx_t_8, __pyx_t_7, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2433: 
+2434: cpdef cython.double nrxysin(gen: mus_any, fm: Optional[float]=0.):
static PyObject *__pyx_pw_8pysndlib_3clm_245nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_nrxysin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_nrxysin *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)__pyx_float_0_);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nrxysin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_245nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_244nrxysin, "\n    next sample of nrxysin generator.\n    \n    :param gen: ncos gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_245nrxysin = {"nrxysin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_245nrxysin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_244nrxysin};
static PyObject *__pyx_pw_8pysndlib_3clm_245nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nrxysin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2434, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2434, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "nrxysin") < 0)) __PYX_ERR(0, 2434, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nrxysin", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2434, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2434, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_244nrxysin(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_244nrxysin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nrxysin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_nrxysin(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2434, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_nrxysin, 2434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 2434, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2434, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2434, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_245nrxysin, 0, __pyx_n_s_nrxysin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__321);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nrxysin, __pyx_t_37) < 0) __PYX_ERR(0, 2434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__321 = PyTuple_Pack(1, __pyx_float_0_); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 2434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_nrxysin {
  int __pyx_n;
  PyObject *fm;
};
 2435:     """
 2436:     next sample of nrxysin generator.
 2437:     
 2438:     :param gen: ncos gen
 2439:     :param fm: fm input
 2440:     :rtype: float
 2441:     """
+2442:     return cclm.mus_nrxysin(gen._ptr, fm)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L1_error)
  __pyx_r = mus_nrxysin(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 2443: 
+2444: cpdef bint is_nrxysin(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_247is_nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_nrxysin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nrxysin", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_247is_nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_246is_nrxysin, "\n    returns True if gen is a nrxysin.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_247is_nrxysin = {"is_nrxysin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_247is_nrxysin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_246is_nrxysin};
static PyObject *__pyx_pw_8pysndlib_3clm_247is_nrxysin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nrxysin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2444, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_nrxysin") < 0)) __PYX_ERR(0, 2444, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_nrxysin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2444, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2444, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_246is_nrxysin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_246is_nrxysin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nrxysin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_nrxysin(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2444, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_nrxysin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2444, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_247is_nrxysin, 0, __pyx_n_s_is_nrxysin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_nrxysin, __pyx_t_41) < 0) __PYX_ERR(0, 2444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_nrxysin, 2444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 2444, __pyx_L1_error)
 2445:     """
 2446:     returns True if gen is a nrxysin.
 2447:     
 2448:     :param gen: gen
 2449:     :rtype: bool
 2450:     """
+2451:     return cclm.mus_is_nrxysin(gen._ptr)
  __pyx_r = mus_is_nrxysin(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2452: 
 2453: 
+2454: cpdef mus_any make_nrxycos(frequency: float, ratio: Optional[float]=1., n: Optional[int]=1, r: Optional[float]=.5):
static PyObject *__pyx_pw_8pysndlib_3clm_249make_nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_nrxycos(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_nrxycos *__pyx_optional_args) {
  PyObject *__pyx_v_ratio = ((PyObject *)__pyx_float_1_);
  PyObject *__pyx_v_n = ((PyObject *)__pyx_int_1);
  PyObject *__pyx_v_r = ((PyObject *)__pyx_float__5);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nrxycos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ratio = __pyx_optional_args->ratio;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_n = __pyx_optional_args->n;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_r = __pyx_optional_args->r;
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_249make_nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_248make_nrxycos, "\n    return a new nrxycos generator.\n    \n    :param frequency: frequency of generator\n    :param ratio: ratio between frequency and the spacing between successive sidebands\n    :param n: number of sidebands\n    :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)\n    :return: nrxycos gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_249make_nrxycos = {"make_nrxycos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_249make_nrxycos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_248make_nrxycos};
static PyObject *__pyx_pw_8pysndlib_3clm_249make_nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_ratio = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_v_r = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nrxycos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_ratio,&__pyx_n_s_n,&__pyx_n_s_r,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_);
    values[2] = ((PyObject *)__pyx_int_1);
    values[3] = ((PyObject *)__pyx_float__5);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ratio);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_nrxycos") < 0)) __PYX_ERR(0, 2454, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
    __pyx_v_ratio = values[1];
    __pyx_v_n = values[2];
    __pyx_v_r = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_nrxycos", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 2454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_248make_nrxycos(__pyx_self, __pyx_v_frequency, __pyx_v_ratio, __pyx_v_n, __pyx_v_r);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_248make_nrxycos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_ratio, PyObject *__pyx_v_n, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_nrxycos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.ratio = __pyx_v_ratio;
  __pyx_t_2.n = __pyx_v_n;
  __pyx_t_2.r = __pyx_v_r;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_nrxycos(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_nrxycos, 2454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(0, 2454, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_ratio, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_n, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_r, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_249make_nrxycos, 0, __pyx_n_s_make_nrxycos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__324);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_nrxycos, __pyx_t_37) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__324 = PyTuple_Pack(3, __pyx_float_1_, __pyx_int_1, __pyx_float__5); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(0, 2454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_nrxycos {
  int __pyx_n;
  PyObject *ratio;
  PyObject *n;
  PyObject *r;
};
 2455:     """
 2456:     return a new nrxycos generator.
 2457:     
 2458:     :param frequency: frequency of generator
 2459:     :param ratio: ratio between frequency and the spacing between successive sidebands
 2460:     :param n: number of sidebands
 2461:     :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)
 2462:     :return: nrxycos gen
 2463:     :rtype: mus_any
 2464:     """
 2465: 
+2466:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2467:     check_range('r', r, -1.0, 1.0)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_r, __pyx_v_r, __pyx_float_neg_1_0, __pyx_float_1_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2468:     check_range('n', n, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_n, __pyx_v_n, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2469: 
+2470:     return mus_any.from_ptr(cclm.mus_make_nrxycos(frequency, ratio, n, r))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_ratio); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2470, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2470, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_r); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2470, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_nrxycos(__pyx_v_frequency, __pyx_t_8, __pyx_t_7, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2471: 
+2472: cpdef cython.double nrxycos(gen: mus_any, fm: Optional[float]=0.):
static PyObject *__pyx_pw_8pysndlib_3clm_251nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_nrxycos(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_nrxycos *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)__pyx_float_0_);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nrxycos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_251nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_250nrxycos, "\n    next sample of nrxycos generator.\n    \n    :param gen: ncos gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_251nrxycos = {"nrxycos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_251nrxycos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_250nrxycos};
static PyObject *__pyx_pw_8pysndlib_3clm_251nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nrxycos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "nrxycos") < 0)) __PYX_ERR(0, 2472, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nrxycos", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2472, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2472, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_250nrxycos(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_250nrxycos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nrxycos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_nrxycos(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_nrxycos, 2472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(0, 2472, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2472, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2472, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_251nrxycos, 0, __pyx_n_s_nrxycos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__325)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__326);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nrxycos, __pyx_t_41) < 0) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__326 = PyTuple_Pack(1, __pyx_float_0_); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_nrxycos {
  int __pyx_n;
  PyObject *fm;
};
 2473:     """
 2474:     next sample of nrxycos generator.
 2475:     
 2476:     :param gen: ncos gen
 2477:     :param fm: fm input
 2478:     :rtype: float
 2479:     """
+2480:     return cclm.mus_nrxycos(gen._ptr, fm)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2480, __pyx_L1_error)
  __pyx_r = mus_nrxycos(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 2481: 
+2482: cpdef bint is_nrxycos(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_253is_nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_nrxycos(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nrxycos", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_253is_nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_252is_nrxycos, "\n    returns True if gen is a nrxycos.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_253is_nrxycos = {"is_nrxycos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_253is_nrxycos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_252is_nrxycos};
static PyObject *__pyx_pw_8pysndlib_3clm_253is_nrxycos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nrxycos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2482, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_nrxycos") < 0)) __PYX_ERR(0, 2482, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_nrxycos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2482, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2482, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_252is_nrxycos(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_252is_nrxycos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_nrxycos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_nrxycos(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2482, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_nrxycos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2482, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_253is_nrxycos, 0, __pyx_n_s_is_nrxycos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_nrxycos, __pyx_t_37) < 0) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_nrxycos, 2482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(0, 2482, __pyx_L1_error)
 2483:     """
 2484:     returns True if gen is a nrxycos.
 2485:     
 2486:     :param gen: gen
 2487:     :rtype: bool
 2488:     """
+2489:     return cclm.mus_is_nrxycos(gen._ptr)
  __pyx_r = mus_is_nrxycos(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2490: 
 2491: 
 2492: # ---------------- rxykcos and rxyksin ---------------- #    
+2493: cpdef mus_any make_rxykcos(frequency: float, phase: Optional[float]=0.0, r: Optional[float]=.5, ratio: Optional[float]=1.):
static PyObject *__pyx_pw_8pysndlib_3clm_255make_rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_rxykcos(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_rxykcos *__pyx_optional_args) {
  PyObject *__pyx_v_phase = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_r = ((PyObject *)__pyx_float__5);
  PyObject *__pyx_v_ratio = ((PyObject *)__pyx_float_1_);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rxykcos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_phase = __pyx_optional_args->phase;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_r = __pyx_optional_args->r;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ratio = __pyx_optional_args->ratio;
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_255make_rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_254make_rxykcos, "\n    return a new rxykcos generator.\n    \n    :param frequency: frequency of generator\n    :param ratio: ratio between frequency and the spacing between successive sidebands\n    :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)\n    :return: rxykcos gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_255make_rxykcos = {"make_rxykcos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_255make_rxykcos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_254make_rxykcos};
static PyObject *__pyx_pw_8pysndlib_3clm_255make_rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_phase = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_ratio = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rxykcos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_phase,&__pyx_n_s_r,&__pyx_n_s_ratio,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_float_0_0);
    values[2] = ((PyObject *)__pyx_float__5);
    values[3] = ((PyObject *)__pyx_float_1_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phase);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ratio);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_rxykcos") < 0)) __PYX_ERR(0, 2493, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
    __pyx_v_phase = values[1];
    __pyx_v_r = values[2];
    __pyx_v_ratio = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_rxykcos", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 2493, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_254make_rxykcos(__pyx_self, __pyx_v_frequency, __pyx_v_phase, __pyx_v_r, __pyx_v_ratio);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_254make_rxykcos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_phase, PyObject *__pyx_v_r, PyObject *__pyx_v_ratio) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rxykcos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.phase = __pyx_v_phase;
  __pyx_t_2.r = __pyx_v_r;
  __pyx_t_2.ratio = __pyx_v_ratio;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_rxykcos(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__328 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_phase, __pyx_n_s_r, __pyx_n_s_ratio); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_rxykcos, 2493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(0, 2493, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_r, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_ratio, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_255make_rxykcos, 0, __pyx_n_s_make_rxykcos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__330);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_rxykcos, __pyx_t_41) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__330 = PyTuple_Pack(3, __pyx_float_0_0, __pyx_float__5, __pyx_float_1_); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_rxykcos {
  int __pyx_n;
  PyObject *phase;
  PyObject *r;
  PyObject *ratio;
};
 2494:     """
 2495:     return a new rxykcos generator.
 2496:     
 2497:     :param frequency: frequency of generator
 2498:     :param ratio: ratio between frequency and the spacing between successive sidebands
 2499:     :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)
 2500:     :return: rxykcos gen
 2501:     :rtype: mus_any
 2502:     """
+2503:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2503, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2504:     check_range('r', r, -1.0, 1.0)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_r, __pyx_v_r, __pyx_float_neg_1_0, __pyx_float_1_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2505: 
+2506:     return mus_any.from_ptr(cclm.mus_make_rxykcos(frequency, phase, r, ratio))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2506, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_r); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2506, __pyx_L1_error)
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_ratio); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2506, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_rxykcos(__pyx_v_frequency, __pyx_t_8, __pyx_t_9, __pyx_t_10), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2507: 
+2508: cpdef cython.double rxykcos(gen: mus_any, fm: Optional[float]=0.):
static PyObject *__pyx_pw_8pysndlib_3clm_257rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_rxykcos(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_rxykcos *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)__pyx_float_0_);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rxykcos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_257rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_256rxykcos, "\n    next sample of rxykcos generator.\n    \n    :param gen: rxykcos gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_257rxykcos = {"rxykcos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_257rxykcos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_256rxykcos};
static PyObject *__pyx_pw_8pysndlib_3clm_257rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rxykcos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2508, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2508, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rxykcos") < 0)) __PYX_ERR(0, 2508, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rxykcos", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2508, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2508, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_256rxykcos(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_256rxykcos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rxykcos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_rxykcos(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2508, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_rxykcos, 2508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(0, 2508, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_257rxykcos, 0, __pyx_n_s_rxykcos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__332);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rxykcos, __pyx_t_37) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__332 = PyTuple_Pack(1, __pyx_float_0_); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_rxykcos {
  int __pyx_n;
  PyObject *fm;
};
 2509:     """
 2510:     next sample of rxykcos generator.
 2511:     
 2512:     :param gen: rxykcos gen
 2513:     :param fm: fm input
 2514:     :rtype: float
 2515:     """
+2516:     return cclm.mus_rxykcos(gen._ptr, fm)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2516, __pyx_L1_error)
  __pyx_r = mus_rxykcos(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 2517: 
+2518: cpdef bint is_rxykcos(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_259is_rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_rxykcos(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rxykcos", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_259is_rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_258is_rxykcos, "\n    returns True if gen is a rxykcos.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_259is_rxykcos = {"is_rxykcos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_259is_rxykcos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_258is_rxykcos};
static PyObject *__pyx_pw_8pysndlib_3clm_259is_rxykcos(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rxykcos (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2518, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_rxykcos") < 0)) __PYX_ERR(0, 2518, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_rxykcos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2518, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_258is_rxykcos(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_258is_rxykcos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rxykcos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_rxykcos(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2518, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_rxykcos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2518, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_259is_rxykcos, 0, __pyx_n_s_is_rxykcos, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__333)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_rxykcos, __pyx_t_41) < 0) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_rxykcos, 2518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(0, 2518, __pyx_L1_error)
 2519:     """
 2520:     returns True if gen is a rxykcos.
 2521:     
 2522:     :param gen: gen
 2523:     :rtype: bool
 2524:     """
+2525:     return cclm.mus_is_rxykcos(gen._ptr)
  __pyx_r = mus_is_rxykcos(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2526: 
+2527: cpdef mus_any make_rxyksin(frequency: float, phase: cython.double, r: Optional[float]=.5, ratio: Optional[float]=1.):
static PyObject *__pyx_pw_8pysndlib_3clm_261make_rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_rxyksin(double __pyx_v_frequency, double __pyx_v_phase, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_rxyksin *__pyx_optional_args) {
  PyObject *__pyx_v_r = ((PyObject *)__pyx_float__5);
  PyObject *__pyx_v_ratio = ((PyObject *)__pyx_float_1_);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rxyksin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_r = __pyx_optional_args->r;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_ratio = __pyx_optional_args->ratio;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_261make_rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_260make_rxyksin, "\n    return a new rxyksin generator.\n    \n    :param frequency: frequency of generator\n    :param ratio: ratio between frequency and the spacing between successive sidebands\n    :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)\n    :return: rxyksin gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_261make_rxyksin = {"make_rxyksin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_261make_rxyksin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_260make_rxyksin};
static PyObject *__pyx_pw_8pysndlib_3clm_261make_rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  double __pyx_v_phase;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_ratio = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rxyksin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_phase,&__pyx_n_s_r,&__pyx_n_s_ratio,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_float__5);
    values[3] = ((PyObject *)__pyx_float_1_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_phase)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_rxyksin", 0, 2, 4, 1); __PYX_ERR(0, 2527, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ratio);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_rxyksin") < 0)) __PYX_ERR(0, 2527, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
    __pyx_v_phase = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_phase == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
    __pyx_v_r = values[2];
    __pyx_v_ratio = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_rxyksin", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 2527, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_260make_rxyksin(__pyx_self, __pyx_v_frequency, __pyx_v_phase, __pyx_v_r, __pyx_v_ratio);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_260make_rxyksin(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, double __pyx_v_phase, PyObject *__pyx_v_r, PyObject *__pyx_v_ratio) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rxyksin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.r = __pyx_v_r;
  __pyx_t_2.ratio = __pyx_v_ratio;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_rxyksin(__pyx_v_frequency, __pyx_v_phase, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_rxyksin, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(0, 2527, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_phase, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_r, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_ratio, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_261make_rxyksin, 0, __pyx_n_s_make_rxyksin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__335);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_rxyksin, __pyx_t_37) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__335 = PyTuple_Pack(2, __pyx_float__5, __pyx_float_1_); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_rxyksin {
  int __pyx_n;
  PyObject *r;
  PyObject *ratio;
};
 2528:     """
 2529:     return a new rxyksin generator.
 2530:     
 2531:     :param frequency: frequency of generator
 2532:     :param ratio: ratio between frequency and the spacing between successive sidebands
 2533:     :param r: amplitude ratio between successive sidebands (-1.0 < r < 1.0)
 2534:     :return: rxyksin gen
 2535:     :rtype: mus_any
 2536:     """
+2537:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2538:     check_range('r', r, -1.0, 1.0)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_n_s_r, __pyx_v_r, __pyx_float_neg_1_0, __pyx_float_1_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2539: 
+2540:     return mus_any.from_ptr(cclm.mus_make_rxyksin(frequency, phase, r, ratio))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_r); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2540, __pyx_L1_error)
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_ratio); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2540, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_rxyksin(__pyx_v_frequency, __pyx_v_phase, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2541: 
+2542: cpdef cython.double rxyksin(gen:  mus_any, fm: Optional[float]=0.):
static PyObject *__pyx_pw_8pysndlib_3clm_263rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_rxyksin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_rxyksin *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)__pyx_float_0_);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rxyksin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_263rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_262rxyksin, "\n    next sample of rxyksin generator.\n    \n    :param gen: rxyksin gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_263rxyksin = {"rxyksin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_263rxyksin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_262rxyksin};
static PyObject *__pyx_pw_8pysndlib_3clm_263rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rxyksin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rxyksin") < 0)) __PYX_ERR(0, 2542, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rxyksin", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2542, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2542, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_262rxyksin(__pyx_self, __pyx_v_gen, __pyx_v_fm);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_262rxyksin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rxyksin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_rxyksin(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_rxyksin, 2542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(0, 2542, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2542, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2542, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_263rxyksin, 0, __pyx_n_s_rxyksin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__337);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rxyksin, __pyx_t_41) < 0) __PYX_ERR(0, 2542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__337 = PyTuple_Pack(1, __pyx_float_0_); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 2542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_rxyksin {
  int __pyx_n;
  PyObject *fm;
};
 2543:     """
 2544:     next sample of rxyksin generator.
 2545:     
 2546:     :param gen: rxyksin gen
 2547:     :param fm: fm input
 2548:     :rtype: float
 2549:     """
+2550:     return cclm.mus_rxyksin(gen._ptr, fm)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2550, __pyx_L1_error)
  __pyx_r = mus_rxyksin(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 2551: 
+2552: cpdef bint  is_rxyksin(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_265is_rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_rxyksin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rxyksin", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_265is_rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_264is_rxyksin, "\n    returns True if gen is a rxyksin.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_265is_rxyksin = {"is_rxyksin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_265is_rxyksin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_264is_rxyksin};
static PyObject *__pyx_pw_8pysndlib_3clm_265is_rxyksin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rxyksin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2552, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_rxyksin") < 0)) __PYX_ERR(0, 2552, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_rxyksin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2552, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2552, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_264is_rxyksin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_264is_rxyksin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rxyksin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_rxyksin(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2552, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_rxyksin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2552, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_265is_rxyksin, 0, __pyx_n_s_is_rxyksin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__338)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_rxyksin, __pyx_t_37) < 0) __PYX_ERR(0, 2552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_rxyksin, 2552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(0, 2552, __pyx_L1_error)
 2553:     """
 2554:     returns True if gen is a rxyksin.
 2555:     
 2556:     :param gen: gen
 2557:     :rtype: bool
 2558:     """
+2559:     return cclm.mus_is_rxyksin(gen._ptr)
  __pyx_r = mus_is_rxyksin(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2560: 
 2561: # ---------------- ssb-am ---------------- #    
+2562: cpdef mus_any make_ssb_am(frequency: float, order: Optional[int]=40):
static PyObject *__pyx_pw_8pysndlib_3clm_267make_ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_ssb_am(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_ssb_am *__pyx_optional_args) {
  PyObject *__pyx_v_order = ((PyObject *)__pyx_int_40);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_ssb_am", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_order = __pyx_optional_args->order;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_267make_ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_266make_ssb_am, "\n    return a new ssb_am generator.\n    \n    :param frequency: frequency of generator\n    :param order: embedded delay line size\n    :return: ssb_am gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_267make_ssb_am = {"make_ssb_am", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_267make_ssb_am, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_266make_ssb_am};
static PyObject *__pyx_pw_8pysndlib_3clm_267make_ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_order = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_ssb_am (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_order,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_40);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_ssb_am") < 0)) __PYX_ERR(0, 2562, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error)
    __pyx_v_order = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_ssb_am", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2562, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_266make_ssb_am(__pyx_self, __pyx_v_frequency, __pyx_v_order);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_266make_ssb_am(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_order) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_ssb_am", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.order = __pyx_v_order;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_ssb_am(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__339 = PyTuple_Pack(2, __pyx_n_s_frequency, __pyx_n_s_order); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_ssb_am, 2562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) __PYX_ERR(0, 2562, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2562, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_order, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 2562, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_267make_ssb_am, 0, __pyx_n_s_make_ssb_am, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__340)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__341);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_ssb_am, __pyx_t_41) < 0) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__341 = PyTuple_Pack(1, __pyx_int_40); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_ssb_am {
  int __pyx_n;
  PyObject *order;
};
 2563:     """
 2564:     return a new ssb_am generator.
 2565:     
 2566:     :param frequency: frequency of generator
 2567:     :param order: embedded delay line size
 2568:     :return: ssb_am gen
 2569:     :rtype: mus_any
 2570:     """
+2571:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2571, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2572: 
+2573:     return mus_any.from_ptr(cclm.mus_make_ssb_am(frequency, order))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_order); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2573, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_ssb_am(__pyx_v_frequency, __pyx_t_7), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2574: 
+2575: cpdef cython.double ssb_am(gen: mus_any, insig: float, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_269ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_ssb_am(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_ssb_am *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ssb_am", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_269ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_268ssb_am, "\n    get the next sample from ssb_am generator.\n    \n    :param gen: ssb_am gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_269ssb_am = {"ssb_am", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_269ssb_am, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_268ssb_am};
static PyObject *__pyx_pw_8pysndlib_3clm_269ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ssb_am (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_fm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2575, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2575, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("ssb_am", 0, 2, 3, 1); __PYX_ERR(0, 2575, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2575, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ssb_am") < 0)) __PYX_ERR(0, 2575, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2575, __pyx_L3_error)
    __pyx_v_fm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ssb_am", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2575, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2575, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_268ssb_am(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_268ssb_am(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ssb_am", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_ssb_am(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2575, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__342 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_insig, __pyx_n_s_fm); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 2575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2575, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 2575, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2575, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_269ssb_am, 0, __pyx_n_s_ssb_am, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ssb_am, __pyx_t_37) < 0) __PYX_ERR(0, 2575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_ssb_am, 2575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(0, 2575, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_ssb_am {
  int __pyx_n;
  PyObject *fm;
};
 2576:     """
 2577:     get the next sample from ssb_am generator.
 2578:     
 2579:     :param gen: ssb_am gen
 2580:     :param fm: fm input
 2581:     :rtype: float
 2582:     """
+2583:     if(fm):
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2583, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2584:         return cclm.mus_ssb_am(gen._ptr, insig, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2584, __pyx_L1_error)
    __pyx_r = mus_ssb_am(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 2585:     else:
+2586:         return cclm.mus_ssb_am_unmodulated(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_ssb_am_unmodulated(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 2587: 
+2588: cpdef bint is_ssb_am(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_271is_ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_ssb_am(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ssb_am", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_271is_ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_270is_ssb_am, "\n    returns True if gen is a ssb_am.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_271is_ssb_am = {"is_ssb_am", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_271is_ssb_am, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_270is_ssb_am};
static PyObject *__pyx_pw_8pysndlib_3clm_271is_ssb_am(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ssb_am (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_ssb_am") < 0)) __PYX_ERR(0, 2588, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_ssb_am", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2588, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2588, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_270is_ssb_am(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_270is_ssb_am(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_ssb_am", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_ssb_am(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_ssb_am", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_271is_ssb_am, 0, __pyx_n_s_is_ssb_am, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__344)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_ssb_am, __pyx_t_41) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__344 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_ssb_am, 2588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__344)) __PYX_ERR(0, 2588, __pyx_L1_error)
 2589:     """
 2590:     returns True if gen is a ssb_am.
 2591:     
 2592:     :param gen: gen
 2593:     :rtype: bool
 2594:     """
+2595:     return cclm.mus_is_ssb_am(gen._ptr)
  __pyx_r = mus_is_ssb_am(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2596: 
 2597: 
 2598: 
 2599: # ---------------- wave-train ----------------#
+2600: cpdef mus_any make_wave_train(frequency: float, wave: npt.NDArray[np.float64], initial_phase: Optional[float]=0., interp_type=Interp.LINEAR):
static PyObject *__pyx_pw_8pysndlib_3clm_273make_wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_wave_train(double __pyx_v_frequency, PyObject *__pyx_v_wave, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_wave_train *__pyx_optional_args) {
  PyObject *__pyx_v_initial_phase = ((PyObject *)__pyx_float_0_);
  PyObject *__pyx_v_interp_type = __pyx_k__33;
  __Pyx_memviewslice __pyx_v_wave_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_wave_train", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_phase = __pyx_optional_args->initial_phase;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_interp_type = __pyx_optional_args->interp_type;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_wave);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_wave_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_wave);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_273make_wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_272make_wave_train, "\n    return a new wave-train generator (an extension of pulse-train). frequency is the repetition rate\n    of the wave found \\in wave. successive waves can overlap.\n    \n    :param frequency: frequency of gen \\in hz\n    :param wave: np.ndarray if provided is waveform\n    :param initial_phase: initial phase of gen \\in radians\n    :param interp_type: type of interpolation used\n    :return: wave_train gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_273make_wave_train = {"make_wave_train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_273make_wave_train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_272make_wave_train};
static PyObject *__pyx_pw_8pysndlib_3clm_273make_wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_wave = 0;
  PyObject *__pyx_v_initial_phase = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_wave_train (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_wave,&__pyx_n_s_initial_phase,&__pyx_n_s_interp_type,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_float_0_);
    values[3] = __pyx_k__33;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wave)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_wave_train", 0, 2, 4, 1); __PYX_ERR(0, 2600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_phase);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_wave_train") < 0)) __PYX_ERR(0, 2600, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2600, __pyx_L3_error)
    __pyx_v_wave = values[1];
    __pyx_v_initial_phase = values[2];
    __pyx_v_interp_type = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_wave_train", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 2600, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_272make_wave_train(__pyx_self, __pyx_v_frequency, __pyx_v_wave, __pyx_v_initial_phase, __pyx_v_interp_type);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_272make_wave_train(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_wave, PyObject *__pyx_v_initial_phase, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_wave_train", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.initial_phase = __pyx_v_initial_phase;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_wave_train(__pyx_v_frequency, __pyx_v_wave, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_k__33 = __pyx_t_41;
  __Pyx_GIVEREF(__pyx_t_41);
  __pyx_t_41 = 0;
/* … */
  __pyx_tuple__345 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_wave, __pyx_n_s_initial_phase, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__345);
  __Pyx_GIVEREF(__pyx_tuple__345);
  __pyx_t_41 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = PyTuple_New(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_0_);
  __Pyx_GIVEREF(__pyx_float_0_);
  PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_float_0_);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_37, 1, __pyx_t_41);
  __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2600, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_wave, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 2600, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_initial_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2600, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_273make_wave_train, 0, __pyx_n_s_make_wave_train, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_wave_train, __pyx_t_40) < 0) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_wave_train, 2600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(0, 2600, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_wave_train {
  int __pyx_n;
  PyObject *initial_phase;
  PyObject *interp_type;
};
 2601:     """
 2602:     return a new wave-train generator (an extension of pulse-train). frequency is the repetition rate
 2603:     of the wave found \in wave. successive waves can overlap.
 2604:     
 2605:     :param frequency: frequency of gen \in hz
 2606:     :param wave: np.ndarray if provided is waveform
 2607:     :param initial_phase: initial phase of gen \in radians
 2608:     :param interp_type: type of interpolation used
 2609:     :return: wave_train gen
 2610:     :rtype: mus_any
 2611:     """
+2612:     if isinstance(wave, list):
  __pyx_t_1 = PyList_Check(__pyx_v_wave); 
  if (__pyx_t_1) {
/* … */
  }
+2613:         wave = np.array(wave)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_wave};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_wave, __pyx_t_2);
    __pyx_t_2 = 0;
 2614: 
+2615:     check_ndim(wave)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_wave};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+2616:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L1_error)
  __pyx_t_7 = PyFloat_FromDouble((__pyx_t_6 / 2.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 2617: 
+2618:     cdef double [:] wave_view = wave
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_wave, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __pyx_v_wave_view = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;
+2619:     gen = mus_any.from_ptr(cclm.mus_make_wave_train(frequency, initial_phase, &wave_view[0], len(wave), interp_type))
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_initial_phase); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L1_error)
  __pyx_t_11 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_wave_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_wave_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 2619, __pyx_L1_error)
  }
  __pyx_t_12 = PyObject_Length(__pyx_v_wave); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2619, __pyx_L1_error)
  __pyx_t_13 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_wave_train(__pyx_v_frequency, __pyx_t_10, (&(*((double *) ( /* dim=0 */ (__pyx_v_wave_view.data + __pyx_t_11 * __pyx_v_wave_view.strides[0]) )))), __pyx_t_12, __pyx_t_13), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
+2620:     gen.cache_append(wave)
  __pyx_t_2 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_wave, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+2621:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 2622: 
+2623: cpdef cython.double wave_train(gen: mus_any, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_275wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_wave_train(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_wave_train *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wave_train", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_275wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_274wave_train, "\n    next sample of wave_train.\n    \n    :param gen: wave_train gen\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_275wave_train = {"wave_train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_275wave_train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_274wave_train};
static PyObject *__pyx_pw_8pysndlib_3clm_275wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wave_train (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_fm,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wave_train") < 0)) __PYX_ERR(0, 2623, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_fm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wave_train", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2623, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2623, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_274wave_train(__pyx_self, __pyx_v_gen, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_274wave_train(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wave_train", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_wave_train(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2623, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2623, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_275wave_train, 0, __pyx_n_s_wave_train, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__347)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wave_train, __pyx_t_41) < 0) __PYX_ERR(0, 2623, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_wave_train, 2623, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(0, 2623, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_wave_train {
  int __pyx_n;
  PyObject *fm;
};
 2624:     """
 2625:     next sample of wave_train.
 2626:     
 2627:     :param gen: wave_train gen
 2628:     :param fm: fm input
 2629:     :rtype: float
 2630:     """
+2631:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2631, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2632:         return cclm.mus_wave_train(gen._ptr, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2632, __pyx_L1_error)
    __pyx_r = mus_wave_train(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 2633:     else:
+2634:         return cclm.mus_wave_train_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_wave_train_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 2635: 
+2636: cpdef bint is_wave_train(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_277is_wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_wave_train(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_wave_train", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_277is_wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_276is_wave_train, "\n    returns True if gen is a wave_train.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_277is_wave_train = {"is_wave_train", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_277is_wave_train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_276is_wave_train};
static PyObject *__pyx_pw_8pysndlib_3clm_277is_wave_train(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_wave_train (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2636, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_wave_train") < 0)) __PYX_ERR(0, 2636, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_wave_train", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2636, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2636, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_276is_wave_train(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_276is_wave_train(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_wave_train", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_wave_train(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2636, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_wave_train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2636, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_277is_wave_train, 0, __pyx_n_s_is_wave_train, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_wave_train, __pyx_t_40) < 0) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_wave_train, 2636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(0, 2636, __pyx_L1_error)
 2637:     """
 2638:     returns True if gen is a wave_train.
 2639:     
 2640:     :param gen: gen
 2641:     :rtype: bool
 2642:     """
+2643:     return cclm.mus_is_wave_train(gen._ptr)
  __pyx_r = mus_is_wave_train(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2644: 
 2645: 
+2646: cpdef mus_any make_wave_train_with_env(frequency: float, envelope, size=None):
static PyObject *__pyx_pw_8pysndlib_3clm_279make_wave_train_with_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_wave_train_with_env(double __pyx_v_frequency, PyObject *__pyx_v_envelope, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_wave_train_with_env *__pyx_optional_args) {
  PyObject *__pyx_v_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_wave = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_e = NULL;
  PyObject *__pyx_v_i = NULL;
  __Pyx_memviewslice __pyx_v_wave_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_wave_train_with_env", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_size = __pyx_optional_args->size;
    }
  }
  __Pyx_INCREF(__pyx_v_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_wave_train_with_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wave);
  __Pyx_XDECREF((PyObject *)__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_i);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_wave_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_279make_wave_train_with_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_278make_wave_train_with_env, "\n    return a new wave-train generator with the envelope loaded \\in with size.\n    \n    :param frequency: frequency of gen \\in hz\n    :param env: envelope shape to load into generator\n    :param size: size of wave derived from envelope\n    :return: wave_train gen\n    :rtype: mus_any\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_279make_wave_train_with_env = {"make_wave_train_with_env", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_279make_wave_train_with_env, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_278make_wave_train_with_env};
static PyObject *__pyx_pw_8pysndlib_3clm_279make_wave_train_with_env(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_envelope = 0;
  PyObject *__pyx_v_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_wave_train_with_env (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_envelope,&__pyx_n_s_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_wave_train_with_env", 0, 2, 3, 1); __PYX_ERR(0, 2646, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_wave_train_with_env") < 0)) __PYX_ERR(0, 2646, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
    __pyx_v_envelope = values[1];
    __pyx_v_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_wave_train_with_env", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2646, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_wave_train_with_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_278make_wave_train_with_env(__pyx_self, __pyx_v_frequency, __pyx_v_envelope, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_278make_wave_train_with_env(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_envelope, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_wave_train_with_env", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.size = __pyx_v_size;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_wave_train_with_env(__pyx_v_frequency, __pyx_v_envelope, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_wave_train_with_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2646, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_279make_wave_train_with_env, 0, __pyx_n_s_make_wave_train_with_env, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__349)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_wave_train_with_env, __pyx_t_41) < 0) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_wave_train_with_env, 2646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(0, 2646, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_wave_train_with_env {
  int __pyx_n;
  PyObject *size;
};
 2647:     """
 2648:     return a new wave-train generator with the envelope loaded \in with size.
 2649:     
 2650:     :param frequency: frequency of gen \in hz
 2651:     :param env: envelope shape to load into generator
 2652:     :param size: size of wave derived from envelope
 2653:     :return: wave_train gen
 2654:     :rtype: mus_any
 2655:     
 2656:     """
+2657:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2657, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2658: 
+2659:     size = size or CLM.table_size
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_size); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 2659, __pyx_L1_error)
  if (!__pyx_t_8) {
  } else {
    __Pyx_INCREF(__pyx_v_size);
    __pyx_t_1 = __pyx_v_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_table_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_1);
  __pyx_t_1 = 0;
+2660:     wave = np.zeros(size)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_size};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_wave = __pyx_t_1;
  __pyx_t_1 = 0;
+2661:     e = make_env(envelope, length=size)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_make_env); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_envelope);
  __Pyx_GIVEREF(__pyx_v_envelope);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_envelope);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_length, __pyx_v_size) < 0) __PYX_ERR(0, 2661, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8pysndlib_3clm_mus_any))))) __PYX_ERR(0, 2661, __pyx_L1_error)
  __pyx_v_e = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
  __pyx_t_3 = 0;
+2662:     for i in range(size):
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2662, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 2662, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 2662, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2662, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;
/* … */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2663:         wave[i] = env(e)
    __pyx_t_4 = __pyx_f_8pysndlib_3clm_env(__pyx_v_e, 0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2663, __pyx_L1_error)
    __pyx_t_3 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((PyObject_SetItem(__pyx_v_wave, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2664:     cdef double [:] wave_view = wave
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_wave, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2664, __pyx_L1_error)
  __pyx_v_wave_view = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;
+2665:     gen = mus_any.from_ptr(cclm.mus_make_wave_train(frequency, 0.0, &wave_view[0], size, <cclm.mus_interp_t>Interp.LINEAR))
  __pyx_t_12 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_v_wave_view.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_v_wave_view.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(0, 2665, __pyx_L1_error)
  }
  __pyx_t_13 = __Pyx_PyInt_As_mus_long_t(__pyx_v_size); if (unlikely((__pyx_t_13 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2665, __pyx_L1_error)
  __pyx_t_5 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_wave_train(__pyx_v_frequency, 0.0, (&(*((double *) ( /* dim=0 */ (__pyx_v_wave_view.data + __pyx_t_12 * __pyx_v_wave_view.strides[0]) )))), __pyx_t_13, ((mus_interp_t)__pyx_e_8pysndlib_3clm_LINEAR)), NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_5);
  __pyx_t_5 = 0;
+2666:     gen.cache_append(wave)
  __pyx_t_5 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_wave, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2667:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 2668: 
 2669: # ---------------- rand, rand_interp ---------------- #
+2670: cpdef mus_any make_rand(frequency: float, amplitude: Optional[float]=1.0, distribution=None):
static PyObject *__pyx_pw_8pysndlib_3clm_281make_rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_rand(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_rand *__pyx_optional_args) {
  PyObject *__pyx_v_amplitude = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_distribution = ((PyObject *)Py_None);
  __Pyx_memviewslice __pyx_v_distribution_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rand", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amplitude = __pyx_optional_args->amplitude;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_distribution = __pyx_optional_args->distribution;
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_distribution_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_281make_rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_280make_rand, "\n    return a new rand generator, producing a sequence of random numbers (a step  function). frequency\n    is the rate at which new numbers are chosen.\n    \n    :param frequency: frequency at which new random numbers occur\n    :param amplitude: numbers are between -amplitude and amplitude\n    :param distribution: distribution envelope\n    :return: rand gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_281make_rand = {"make_rand", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_281make_rand, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_280make_rand};
static PyObject *__pyx_pw_8pysndlib_3clm_281make_rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_amplitude = 0;
  PyObject *__pyx_v_distribution = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rand (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_amplitude,&__pyx_n_s_distribution,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amplitude);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_distribution);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_rand") < 0)) __PYX_ERR(0, 2670, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L3_error)
    __pyx_v_amplitude = values[1];
    __pyx_v_distribution = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_rand", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2670, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_280make_rand(__pyx_self, __pyx_v_frequency, __pyx_v_amplitude, __pyx_v_distribution);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_280make_rand(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_distribution) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rand", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.amplitude = __pyx_v_amplitude;
  __pyx_t_2.distribution = __pyx_v_distribution;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_rand(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__350 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_amplitude, __pyx_n_s_distribution); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_rand, 2670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(0, 2670, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2670, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_amplitude, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2670, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_281make_rand, 0, __pyx_n_s_make_rand, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__351)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__352);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_rand, __pyx_t_40) < 0) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__352 = PyTuple_Pack(2, __pyx_float_1_0, Py_None); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_rand {
  int __pyx_n;
  PyObject *amplitude;
  PyObject *distribution;
};
 2671:     """
 2672:     return a new rand generator, producing a sequence of random numbers (a step  function). frequency
 2673:     is the rate at which new numbers are chosen.
 2674:     
 2675:     :param frequency: frequency at which new random numbers occur
 2676:     :param amplitude: numbers are between -amplitude and amplitude
 2677:     :param distribution: distribution envelope
 2678:     :return: rand gen
 2679:     :rtype: mus_any
 2680:     """
+2681:     check_range('frequency', frequency, 0.0, get_srate())
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2681, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2682:     cdef double [:] distribution_view = None
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2682, __pyx_L1_error)
  __pyx_v_distribution_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 2683: 
+2684:     if distribution:
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_distribution); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2684, __pyx_L1_error)
  if (__pyx_t_9) {
/* … */
  }
+2685:         check_ndim(distribution)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_distribution};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2686:         distribution_view = distribution
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_distribution, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2686, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_distribution_view, 1);
    __pyx_v_distribution_view = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;
+2687:         gen =  mus_any.from_ptr(cclm.mus_make_rand_with_distribution(frequency, amplitude, &distribution_view[0], len(distribution)))
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_amplitude); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2687, __pyx_L1_error)
    __pyx_t_11 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_v_distribution_view.shape[0];
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_v_distribution_view.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(0, 2687, __pyx_L1_error)
    }
    __pyx_t_12 = PyObject_Length(__pyx_v_distribution); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2687, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_rand_with_distribution(__pyx_v_frequency, __pyx_t_10, (&(*((double *) ( /* dim=0 */ (__pyx_v_distribution_view.data + __pyx_t_11 * __pyx_v_distribution_view.strides[0]) )))), __pyx_t_12), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
+2688:         gen.cache_append(distribution)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_distribution, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2689:         return gen
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_gen);
    __pyx_r = __pyx_v_gen;
    goto __pyx_L0;
 2690:     else:
+2691:         return mus_any.from_ptr(cclm.mus_make_rand(frequency, amplitude))
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_amplitude); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2691, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_rand(__pyx_v_frequency, __pyx_t_10), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
 2692: 
+2693: cpdef cython.double rand(gen: mus_any, sweep: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_283rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_rand(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_rand *__pyx_optional_args) {
  PyObject *__pyx_v_sweep = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sweep = __pyx_optional_args->sweep;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_283rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_282rand, "\n    gen's current random number. sweep modulates the rate at which the current number is changed.\n    \n    :param gen: rand gen\n    :param sweep: fm\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_283rand = {"rand", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_283rand, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_282rand};
static PyObject *__pyx_pw_8pysndlib_3clm_283rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_sweep = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_sweep,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2693, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sweep);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2693, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rand") < 0)) __PYX_ERR(0, 2693, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_sweep = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rand", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2693, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2693, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_282rand(__pyx_self, __pyx_v_gen, __pyx_v_sweep);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_282rand(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_sweep) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.sweep = __pyx_v_sweep;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_rand(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2693, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__353 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_sweep); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2693, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_sweep, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2693, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_283rand, 0, __pyx_n_s_rand, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__354)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rand, __pyx_t_41) < 0) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_rand, 2693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(0, 2693, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_rand {
  int __pyx_n;
  PyObject *sweep;
};
 2694:     """
 2695:     gen's current random number. sweep modulates the rate at which the current number is changed.
 2696:     
 2697:     :param gen: rand gen
 2698:     :param sweep: fm
 2699:     :rtype: float
 2700:     
 2701:     """
+2702:     if(sweep):
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sweep); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2702, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2703:         return cclm.mus_rand(gen._ptr, sweep)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_sweep); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L1_error)
    __pyx_r = mus_rand(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 2704:     else:
+2705:         return cclm.mus_rand_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_rand_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 2706: 
+2707: cpdef bint is_rand(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_285is_rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_rand(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rand", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_285is_rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_284is_rand, "\n    returns True if gen is a rand.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_285is_rand = {"is_rand", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_285is_rand, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_284is_rand};
static PyObject *__pyx_pw_8pysndlib_3clm_285is_rand(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rand (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_rand") < 0)) __PYX_ERR(0, 2707, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_rand", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2707, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_284is_rand(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_284is_rand(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rand", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_rand(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_285is_rand, 0, __pyx_n_s_is_rand, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__355)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_rand, __pyx_t_40) < 0) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_rand, 2707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(0, 2707, __pyx_L1_error)
 2708:     """
 2709:     returns True if gen is a rand.
 2710:     
 2711:     :param gen: gen
 2712:     :rtype: bool
 2713:     """
+2714:     return cclm.mus_is_rand(gen._ptr)
  __pyx_r = mus_is_rand(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2715: 
+2716: cpdef mus_any make_rand_interp(frequency: float, amplitude: float, distribution=None):
static PyObject *__pyx_pw_8pysndlib_3clm_287make_rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_rand_interp(double __pyx_v_frequency, double __pyx_v_amplitude, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_rand_interp *__pyx_optional_args) {
  PyObject *__pyx_v_distribution = ((PyObject *)Py_None);
  __Pyx_memviewslice __pyx_v_distribution_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rand_interp", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_distribution = __pyx_optional_args->distribution;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_distribution_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_287make_rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_286make_rand_interp, "\n    return a new rand_interp generator, producing linearly interpolated random numbers. frequency is\n    the rate at which new end-points are chosen.\n    \n    :param frequency: frequency at which new random numbers occur\n    :param amplitude: numbers are between -amplitude and amplitude\n    :param distribution: distribution envelope\n    :return: rand_interp gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_287make_rand_interp = {"make_rand_interp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_287make_rand_interp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_286make_rand_interp};
static PyObject *__pyx_pw_8pysndlib_3clm_287make_rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  double __pyx_v_amplitude;
  PyObject *__pyx_v_distribution = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rand_interp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_amplitude,&__pyx_n_s_distribution,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2716, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amplitude)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2716, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_rand_interp", 0, 2, 3, 1); __PYX_ERR(0, 2716, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_distribution);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2716, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_rand_interp") < 0)) __PYX_ERR(0, 2716, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2716, __pyx_L3_error)
    __pyx_v_amplitude = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_amplitude == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2716, __pyx_L3_error)
    __pyx_v_distribution = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_rand_interp", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2716, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_286make_rand_interp(__pyx_self, __pyx_v_frequency, __pyx_v_amplitude, __pyx_v_distribution);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_286make_rand_interp(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, double __pyx_v_amplitude, PyObject *__pyx_v_distribution) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_rand_interp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.distribution = __pyx_v_distribution;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_rand_interp(__pyx_v_frequency, __pyx_v_amplitude, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_amplitude, __pyx_n_s_float) < 0) __PYX_ERR(0, 2716, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_287make_rand_interp, 0, __pyx_n_s_make_rand_interp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_rand_interp, __pyx_t_41) < 0) __PYX_ERR(0, 2716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_rand_interp, 2716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(0, 2716, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_rand_interp {
  int __pyx_n;
  PyObject *distribution;
};
 2717:     """
 2718:     return a new rand_interp generator, producing linearly interpolated random numbers. frequency is
 2719:     the rate at which new end-points are chosen.
 2720:     
 2721:     :param frequency: frequency at which new random numbers occur
 2722:     :param amplitude: numbers are between -amplitude and amplitude
 2723:     :param distribution: distribution envelope
 2724:     :return: rand_interp gen
 2725:     :rtype: mus_any
 2726:     """
+2727:     check_range('frequency', frequency, 0.0, get_srate())
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2728:     cdef double [:] distribution_view = None
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2728, __pyx_L1_error)
  __pyx_v_distribution_view = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
 2729: 
+2730:     if distribution:
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_distribution); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2730, __pyx_L1_error)
  if (__pyx_t_9) {
/* … */
  }
+2731:         check_ndim(distribution)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_distribution};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2732:         distribution_view = distribution
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_distribution, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2732, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_distribution_view, 1);
    __pyx_v_distribution_view = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;
+2733:         gen = mus_any.from_ptr(cclm.mus_make_rand_interp_with_distribution(frequency, amplitude, &distribution_view[0], len(distribution)))
    __pyx_t_10 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_v_distribution_view.shape[0];
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_v_distribution_view.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(0, 2733, __pyx_L1_error)
    }
    __pyx_t_11 = PyObject_Length(__pyx_v_distribution); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2733, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_rand_interp_with_distribution(__pyx_v_frequency, __pyx_v_amplitude, (&(*((double *) ( /* dim=0 */ (__pyx_v_distribution_view.data + __pyx_t_10 * __pyx_v_distribution_view.strides[0]) )))), __pyx_t_11), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
+2734:         gen.cache_append(distribution)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_distribution, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2735:         return gen
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_gen);
    __pyx_r = __pyx_v_gen;
    goto __pyx_L0;
 2736:     else:
+2737:         return mus_any.from_ptr(cclm.mus_make_rand_interp(frequency, amplitude))
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_rand_interp(__pyx_v_frequency, __pyx_v_amplitude), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
 2738: 
+2739: cpdef rand_interp(gen: mus_any, sweep: Optional[float]=0.):
static PyObject *__pyx_pw_8pysndlib_3clm_289rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_rand_interp(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_rand_interp *__pyx_optional_args) {
  PyObject *__pyx_v_sweep = ((PyObject *)__pyx_float_0_);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand_interp", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sweep = __pyx_optional_args->sweep;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_289rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_288rand_interp, "\n    gen's current (interpolating) random number. fm modulates the rate at which new segment end-points\n    are chosen.\n    \n    :param gen: rand_interp gen\n    :param sweep: fm \n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_289rand_interp = {"rand_interp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_289rand_interp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_288rand_interp};
static PyObject *__pyx_pw_8pysndlib_3clm_289rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_sweep = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand_interp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_sweep,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2739, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sweep);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2739, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rand_interp") < 0)) __PYX_ERR(0, 2739, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_sweep = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rand_interp", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2739, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2739, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_288rand_interp(__pyx_self, __pyx_v_gen, __pyx_v_sweep);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_288rand_interp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_sweep) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand_interp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.sweep = __pyx_v_sweep;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_rand_interp(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_rand_interp, 2739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(0, 2739, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_sweep, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_289rand_interp, 0, __pyx_n_s_rand_interp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__357)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__358);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rand_interp, __pyx_t_40) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__358 = PyTuple_Pack(1, __pyx_float_0_); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_rand_interp {
  int __pyx_n;
  PyObject *sweep;
};
 2740:     """
 2741:     gen's current (interpolating) random number. fm modulates the rate at which new segment end-points
 2742:     are chosen.
 2743:     
 2744:     :param gen: rand_interp gen
 2745:     :param sweep: fm 
 2746:     :rtype: float
 2747:     """
+2748:     if(sweep):
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sweep); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2748, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2749:         return cclm.mus_rand_interp(gen._ptr, sweep)
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_sweep); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2749, __pyx_L1_error)
    __pyx_t_3 = PyFloat_FromDouble(mus_rand_interp(__pyx_v_gen->_ptr, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
 2750:     else:
+2751:         return cclm.mus_rand_interp_unmodulated(gen._ptr)
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyFloat_FromDouble(mus_rand_interp_unmodulated(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
 2752: 
+2753: cpdef bint is_rand_interp(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_291is_rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_rand_interp(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rand_interp", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_291is_rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_290is_rand_interp, "\n    returns True if gen is a rand_interp.\n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_291is_rand_interp = {"is_rand_interp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_291is_rand_interp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_290is_rand_interp};
static PyObject *__pyx_pw_8pysndlib_3clm_291is_rand_interp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rand_interp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2753, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_rand_interp") < 0)) __PYX_ERR(0, 2753, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_rand_interp", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2753, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2753, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_290is_rand_interp(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_290is_rand_interp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_rand_interp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_rand_interp(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2753, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_rand_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2753, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_291is_rand_interp, 0, __pyx_n_s_is_rand_interp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__359)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_rand_interp, __pyx_t_41) < 0) __PYX_ERR(0, 2753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_rand_interp, 2753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(0, 2753, __pyx_L1_error)
 2754:     """
 2755:     returns True if gen is a rand_interp.
 2756:     :param gen: gen
 2757:     :rtype: bool
 2758:     """
+2759:     return cclm.mus_is_rand_interp(gen._ptr)
  __pyx_r = mus_is_rand_interp(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2760: 
 2761: 
 2762: # ---------------- simple filters ---------------- #
+2763: cpdef mus_any make_one_pole(a0: cython.double, b1: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_293make_one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_one_pole(double __pyx_v_a0, double __pyx_v_b1, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_pole", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_293make_one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_292make_one_pole, "\n    return a new one_pole filter: y(n) = a0 x(n) - b1 y(n-1)\n    b1 < 0.0 gives lowpass, b1 > 0.0 gives highpass.\n    \n    :param a0: coefficient\n    :param b1: coefficient\n    :return: one_pole gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_293make_one_pole = {"make_one_pole", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_293make_one_pole, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_292make_one_pole};
static PyObject *__pyx_pw_8pysndlib_3clm_293make_one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_a0;
  double __pyx_v_b1;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_pole (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_b1,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a0)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_one_pole", 1, 2, 2, 1); __PYX_ERR(0, 2763, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_one_pole") < 0)) __PYX_ERR(0, 2763, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_a0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_a0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
    __pyx_v_b1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_b1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_one_pole", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2763, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_292make_one_pole(__pyx_self, __pyx_v_a0, __pyx_v_b1);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_292make_one_pole(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_a0, double __pyx_v_b1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_pole", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_one_pole(__pyx_v_a0, __pyx_v_b1, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__360 = PyTuple_Pack(2, __pyx_n_s_a0, __pyx_n_s_b1); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_a0, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_b1, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_293make_one_pole, 0, __pyx_n_s_make_one_pole, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__361)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_one_pole, __pyx_t_40) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_one_pole, 2763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) __PYX_ERR(0, 2763, __pyx_L1_error)
 2764:     """
 2765:     return a new one_pole filter: y(n) = a0 x(n) - b1 y(n-1)
 2766:     b1 < 0.0 gives lowpass, b1 > 0.0 gives highpass.
 2767:     
 2768:     :param a0: coefficient
 2769:     :param b1: coefficient
 2770:     :return: one_pole gen
 2771:     :rtype: mus_any
 2772:     """
 2773: 
+2774:     return mus_any.from_ptr(cclm.mus_make_one_pole(a0, b1))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_one_pole(__pyx_v_a0, __pyx_v_b1), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2775: 
 2776: 
 2777: 
+2778: cpdef cython.double one_pole(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_295one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_one_pole(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_pole", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_295one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_294one_pole, "\n    one pole filter of input.\n    \n    :param gen: one_pole gen\n    :param insig: input \n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_295one_pole = {"one_pole", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_295one_pole, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_294one_pole};
static PyObject *__pyx_pw_8pysndlib_3clm_295one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_pole (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2778, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2778, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("one_pole", 1, 2, 2, 1); __PYX_ERR(0, 2778, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "one_pole") < 0)) __PYX_ERR(0, 2778, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2778, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("one_pole", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2778, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2778, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_294one_pole(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_294one_pole(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_pole", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_one_pole(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2778, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__362 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_insig); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_295one_pole, 0, __pyx_n_s_one_pole, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__363)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_one_pole, __pyx_t_41) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_one_pole, 2778, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(0, 2778, __pyx_L1_error)
 2779:     """
 2780:     one pole filter of input.
 2781:     
 2782:     :param gen: one_pole gen
 2783:     :param insig: input 
 2784:     :rtype: float
 2785:     """
 2786: 
+2787:     return cclm.mus_one_pole(gen._ptr, insig)
  __pyx_r = mus_one_pole(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 2788: 
+2789: cpdef bint is_one_pole(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_297is_one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_one_pole(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_pole", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_297is_one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_296is_one_pole, "\n    returns True if gen is a one_pole.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_297is_one_pole = {"is_one_pole", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_297is_one_pole, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_296is_one_pole};
static PyObject *__pyx_pw_8pysndlib_3clm_297is_one_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_pole (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2789, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_one_pole") < 0)) __PYX_ERR(0, 2789, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_one_pole", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2789, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2789, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_296is_one_pole(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_296is_one_pole(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_pole", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_one_pole(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2789, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_one_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2789, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_297is_one_pole, 0, __pyx_n_s_is_one_pole, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_one_pole, __pyx_t_40) < 0) __PYX_ERR(0, 2789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_one_pole, 2789, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(0, 2789, __pyx_L1_error)
 2790:     """
 2791:     returns True if gen is a one_pole.
 2792:     
 2793:     :param gen: gen
 2794:     :rtype: bool
 2795:     """
+2796:     return cclm.mus_is_one_pole(gen._ptr)
  __pyx_r = mus_is_one_pole(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2797: 
 2798: 
+2799: cpdef mus_any make_one_zero(a0: float, a1: float):
static PyObject *__pyx_pw_8pysndlib_3clm_299make_one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_one_zero(double __pyx_v_a0, double __pyx_v_a1, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_zero", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_299make_one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_298make_one_zero, "\n    return a new one_zero filter: y(n) = a0 x(n) + a1 x(n-1)\n    a1 > 0.0 gives weak lowpass, a1 < 0.0 highpass.\n    \n    :param a0: coefficient\n    :param a1: coefficient\n    :return: one_pole gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_299make_one_zero = {"make_one_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_299make_one_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_298make_one_zero};
static PyObject *__pyx_pw_8pysndlib_3clm_299make_one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_a0;
  double __pyx_v_a1;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_zero (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a1,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a0)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_one_zero", 1, 2, 2, 1); __PYX_ERR(0, 2799, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_one_zero") < 0)) __PYX_ERR(0, 2799, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_a0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_a0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L3_error)
    __pyx_v_a1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_a1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_one_zero", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2799, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_298make_one_zero(__pyx_self, __pyx_v_a0, __pyx_v_a1);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_298make_one_zero(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_a0, double __pyx_v_a1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_zero", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_one_zero(__pyx_v_a0, __pyx_v_a1, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__365 = PyTuple_Pack(2, __pyx_n_s_a0, __pyx_n_s_a1); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_a0, __pyx_n_s_float) < 0) __PYX_ERR(0, 2799, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_a1, __pyx_n_s_float) < 0) __PYX_ERR(0, 2799, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_299make_one_zero, 0, __pyx_n_s_make_one_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_one_zero, __pyx_t_41) < 0) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_one_zero, 2799, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 2799, __pyx_L1_error)
 2800:     """
 2801:     return a new one_zero filter: y(n) = a0 x(n) + a1 x(n-1)
 2802:     a1 > 0.0 gives weak lowpass, a1 < 0.0 highpass.
 2803:     
 2804:     :param a0: coefficient
 2805:     :param a1: coefficient
 2806:     :return: one_pole gen
 2807:     :rtype: mus_any
 2808:     """
+2809:     return mus_any.from_ptr(cclm.mus_make_one_zero(a0, a1))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_one_zero(__pyx_v_a0, __pyx_v_a1), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2810: 
+2811: cpdef cython.double one_zero(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_301one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_one_zero(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_zero", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_301one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_300one_zero, "\n    one zero filter of input.\n    \n    :param gen: one_zero gen\n    :param insig: input \n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_301one_zero = {"one_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_301one_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_300one_zero};
static PyObject *__pyx_pw_8pysndlib_3clm_301one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_zero (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2811, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2811, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("one_zero", 1, 2, 2, 1); __PYX_ERR(0, 2811, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "one_zero") < 0)) __PYX_ERR(0, 2811, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2811, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("one_zero", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2811, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2811, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_300one_zero(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_300one_zero(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_zero", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_one_zero(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2811, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2811, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 2811, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_301one_zero, 0, __pyx_n_s_one_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__367)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_one_zero, __pyx_t_40) < 0) __PYX_ERR(0, 2811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_one_zero, 2811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) __PYX_ERR(0, 2811, __pyx_L1_error)
 2812:     """
 2813:     one zero filter of input.
 2814:     
 2815:     :param gen: one_zero gen
 2816:     :param insig: input 
 2817:     :rtype: float
 2818:     """
+2819:     return cclm.mus_one_zero(gen._ptr, insig)
  __pyx_r = mus_one_zero(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 2820: 
+2821: cpdef bint is_one_zero(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_303is_one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_one_zero(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_zero", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_303is_one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_302is_one_zero, "\n    returns True if gen is a one_zero.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_303is_one_zero = {"is_one_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_303is_one_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_302is_one_zero};
static PyObject *__pyx_pw_8pysndlib_3clm_303is_one_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_zero (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2821, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_one_zero") < 0)) __PYX_ERR(0, 2821, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_one_zero", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2821, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2821, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_302is_one_zero(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_302is_one_zero(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_zero", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_one_zero(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2821, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_one_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2821, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_303is_one_zero, 0, __pyx_n_s_is_one_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_one_zero, __pyx_t_41) < 0) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_one_zero, 2821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(0, 2821, __pyx_L1_error)
 2822:     """
 2823:     returns True if gen is a one_zero.
 2824:     
 2825:     :param gen: gen
 2826:     :rtype: bool
 2827:     """
+2828:     return cclm.mus_is_one_zero(gen._ptr)
  __pyx_r = mus_is_one_zero(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2829: 
 2830: # make def for *args. are there other ways
+2831: def make_two_pole(frequency: [Optional]=None, radius: [Optional]=None, **kwargs):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_305make_two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_304make_two_pole, "\n    return a new two_pole filter: y(n) = a0 x(n) - b1 y(n-1) - b2 y(n-2).\n    \n    :param frequency: Center frequency \\in Hz\n    :param radius: Radius of filter. Refers to the unit circle, so it should be between 0.0 and (less than) 1.0. \n    :param kwargs: If frequency and radius not provided, these should be keyword arguments 'a0', 'b1', 'b2'\n    :return: two_pole gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_305make_two_pole = {"make_two_pole", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_305make_two_pole, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_304make_two_pole};
static PyObject *__pyx_pw_8pysndlib_3clm_305make_two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_frequency = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_two_pole (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_radius,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2831, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2831, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "make_two_pole") < 0)) __PYX_ERR(0, 2831, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = values[0];
    __pyx_v_radius = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_two_pole", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 2831, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pysndlib.clm.make_two_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_304make_two_pole(__pyx_self, __pyx_v_frequency, __pyx_v_radius, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_304make_two_pole(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_radius, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_two_pole", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_two_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__369 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_radius, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_two_pole, 2831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(0, 2831, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_kp_s_Optional) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_radius, __pyx_kp_s_Optional) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_305make_two_pole, 0, __pyx_n_s_make_two_pole, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__370)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__371);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_two_pole, __pyx_t_40) < 0) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__371 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
 2832:     """
 2833:     return a new two_pole filter: y(n) = a0 x(n) - b1 y(n-1) - b2 y(n-2).
 2834:     
 2835:     :param frequency: Center frequency \in Hz
 2836:     :param radius: Radius of filter. Refers to the unit circle, so it should be between 0.0 and (less than) 1.0. 
 2837:     :param kwargs: If frequency and radius not provided, these should be keyword arguments 'a0', 'b1', 'b2'
 2838:     :return: two_pole gen
 2839:     :rtype: mus_any
 2840:     """
 2841: 
+2842:     if kwargs:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2842, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2843:         if 'a0' in kwargs and 'b1' in kwargs and 'b2' in kwargs:
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_a0, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2843, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_b1, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2843, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_b2, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2843, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (likely(__pyx_t_1)) {
/* … */
    }
+2844:             return mus_any.from_ptr(cclm.mus_make_two_pole(kwargs.get('a0'), kwargs.get('b1'), kwargs.get('b2')))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_a0, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_b1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_b2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_two_pole(__pyx_t_4, __pyx_t_5, __pyx_t_6), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
 2845:         else:
+2846:             raise KeyError(f'Filter needs values for a0, b1, b2')
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2846, __pyx_L1_error)
    }
/* … */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Filter_needs_values_for_a0_b1_b2); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
 2847: 
 2848:     else:
+2849:         if frequency is not None and radius is not None:
  /*else*/ {
    __pyx_t_2 = (__pyx_v_frequency != Py_None);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_radius != Py_None);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;
    if (likely(__pyx_t_1)) {
/* … */
    }
+2850:             return mus_any.from_ptr(cclm.mus_make_two_pole_from_frequency_and_radius(frequency, radius))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_frequency); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2850, __pyx_L1_error)
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_radius); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2850, __pyx_L1_error)
      __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_two_pole_from_frequency_and_radius(__pyx_t_6, __pyx_t_5), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2850, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
 2851:         else:
+2852:             raise RuntimeError("If not specifying coeffs, must provide frequency and radius.")
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2852, __pyx_L1_error)
    }
  }
/* … */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_If_not_specifying_coeffs_must_pr); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
 2853: 
+2854: cpdef cython.double two_pole(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_307two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_two_pole(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("two_pole", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_307two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_306two_pole, "\n    two pole filter of input.\n    \n    :param gen: two_pole gen\n    :param insig: input \n    :rtype: float  \n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_307two_pole = {"two_pole", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_307two_pole, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_306two_pole};
static PyObject *__pyx_pw_8pysndlib_3clm_307two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("two_pole (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("two_pole", 1, 2, 2, 1); __PYX_ERR(0, 2854, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "two_pole") < 0)) __PYX_ERR(0, 2854, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("two_pole", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2854, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.two_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2854, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_306two_pole(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_306two_pole(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("two_pole", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_two_pole(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.two_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_307two_pole, 0, __pyx_n_s_two_pole, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_two_pole, __pyx_t_41) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_two_pole, 2854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 2854, __pyx_L1_error)
 2855:     """
 2856:     two pole filter of input.
 2857:     
 2858:     :param gen: two_pole gen
 2859:     :param insig: input 
 2860:     :rtype: float  
 2861:     
 2862:     """
+2863:     return cclm.mus_two_pole(gen._ptr, insig)
  __pyx_r = mus_two_pole(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 2864: 
+2865: cpdef bint is_two_pole(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_309is_two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_two_pole(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_pole", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_309is_two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_308is_two_pole, "\n    returns True if gen is a two_pole.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_309is_two_pole = {"is_two_pole", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_309is_two_pole, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_308is_two_pole};
static PyObject *__pyx_pw_8pysndlib_3clm_309is_two_pole(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_pole (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2865, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_two_pole") < 0)) __PYX_ERR(0, 2865, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_two_pole", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2865, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_two_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2865, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_308is_two_pole(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_308is_two_pole(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_pole", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_two_pole(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2865, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_two_pole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_309is_two_pole, 0, __pyx_n_s_is_two_pole, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__373)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_two_pole, __pyx_t_40) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_two_pole, 2865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) __PYX_ERR(0, 2865, __pyx_L1_error)
 2866:     """
 2867:     returns True if gen is a two_pole.
 2868:     
 2869:     :param gen: gen
 2870:     :rtype: bool
 2871:     """
+2872:     return cclm.mus_is_two_pole(gen._ptr)
  __pyx_r = mus_is_two_pole(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2873: 
 2874: # make def for *args. are there other ways
+2875: def make_two_zero(frequency: [Optional]=None, radius: [Optional]=None, **kwargs):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_311make_two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_310make_two_zero, "\n    return a new two_zero filter: y(n) = a0 x(n) + a1 x(n-1) + a2 x(n-2).\n    \n    :param frequency: Center frequency \\in Hz\n    :param radius: Radius of filter. Refers to the unit circle, so it should be between 0.0 and (less than) 1.0. \n    :param kwargs: If frequency and radius not provided, these should be keyword arguments 'a0', 'a1', 'a2'\n    :return: two_zero gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_311make_two_zero = {"make_two_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_311make_two_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_310make_two_zero};
static PyObject *__pyx_pw_8pysndlib_3clm_311make_two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_frequency = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_two_zero (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_radius,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2875, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2875, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "make_two_zero") < 0)) __PYX_ERR(0, 2875, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = values[0];
    __pyx_v_radius = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_two_zero", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 2875, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pysndlib.clm.make_two_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_310make_two_zero(__pyx_self, __pyx_v_frequency, __pyx_v_radius, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_310make_two_zero(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_radius, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_two_zero", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_two_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_two_zero, 2875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 2875, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_frequency, __pyx_kp_s_Optional) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_radius, __pyx_kp_s_Optional) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_311make_two_zero, 0, __pyx_n_s_make_two_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__375);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_two_zero, __pyx_t_41) < 0) __PYX_ERR(0, 2875, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__375 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 2875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__375);
  __Pyx_GIVEREF(__pyx_tuple__375);
 2876:     """
 2877:     return a new two_zero filter: y(n) = a0 x(n) + a1 x(n-1) + a2 x(n-2).
 2878:     
 2879:     :param frequency: Center frequency \in Hz
 2880:     :param radius: Radius of filter. Refers to the unit circle, so it should be between 0.0 and (less than) 1.0. 
 2881:     :param kwargs: If frequency and radius not provided, these should be keyword arguments 'a0', 'a1', 'a2'
 2882:     :return: two_zero gen
 2883:     :rtype: mus_any
 2884:     """
 2885: 
+2886:     if kwargs:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2886, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2887:         if 'a0' in kwargs and 'a1' in kwargs and 'a1' in kwargs:
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_a0, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2887, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_a1, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2887, __pyx_L1_error)
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_a1, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2887, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (likely(__pyx_t_1)) {
/* … */
    }
+2888:             return mus_any.from_ptr(cclm.mus_make_two_zero(kwargs.get('a0'), kwargs.get('a1'), kwargs.get('a2')))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_a0, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_a1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_a2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_two_zero(__pyx_t_4, __pyx_t_5, __pyx_t_6), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
 2889:         else:
+2890:             raise KeyError(f'Filter needs values for a0, a1, a2')
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2890, __pyx_L1_error)
    }
/* … */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Filter_needs_values_for_a0_a1_a2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
 2891: 
 2892:     else:
+2893:         if frequency is not None and radius is not None:
  /*else*/ {
    __pyx_t_2 = (__pyx_v_frequency != Py_None);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_radius != Py_None);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;
    if (likely(__pyx_t_1)) {
/* … */
    }
+2894:             return mus_any.from_ptr(cclm.mus_make_two_zero_from_frequency_and_radius(frequency, radius))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_frequency); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2894, __pyx_L1_error)
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_radius); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2894, __pyx_L1_error)
      __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_two_zero_from_frequency_and_radius(__pyx_t_6, __pyx_t_5), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
 2895:         else:
+2896:             raise RuntimeError("If not specifying coeffs, must provide frequency and radius.")
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2896, __pyx_L1_error)
    }
  }
 2897: 
+2898: cpdef cython.double two_zero(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_313two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_two_zero(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("two_zero", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_313two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_312two_zero, "\n    two zero filter of input. \n    \n    :param gen: two_zero gen\n    :param insig: input \n    :rtype: float  \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_313two_zero = {"two_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_313two_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_312two_zero};
static PyObject *__pyx_pw_8pysndlib_3clm_313two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("two_zero (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2898, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2898, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("two_zero", 1, 2, 2, 1); __PYX_ERR(0, 2898, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "two_zero") < 0)) __PYX_ERR(0, 2898, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2898, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("two_zero", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2898, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.two_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2898, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_312two_zero(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_312two_zero(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("two_zero", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_two_zero(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2898, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.two_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_313two_zero, 0, __pyx_n_s_two_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__376)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_two_zero, __pyx_t_40) < 0) __PYX_ERR(0, 2898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__376 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_two_zero, 2898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__376)) __PYX_ERR(0, 2898, __pyx_L1_error)
 2899:     """
 2900:     two zero filter of input. 
 2901:     
 2902:     :param gen: two_zero gen
 2903:     :param insig: input 
 2904:     :rtype: float  
 2905:     """
+2906:     return cclm.mus_two_zero(gen._ptr, insig)
  __pyx_r = mus_two_zero(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 2907: 
+2908: cpdef bint is_two_zero(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_315is_two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_two_zero(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_zero", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_315is_two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_314is_two_zero, "\n    returns True if gen is a two_zero.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_315is_two_zero = {"is_two_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_315is_two_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_314is_two_zero};
static PyObject *__pyx_pw_8pysndlib_3clm_315is_two_zero(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_zero (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2908, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_two_zero") < 0)) __PYX_ERR(0, 2908, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_two_zero", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2908, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_two_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2908, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_314is_two_zero(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_314is_two_zero(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_two_zero", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_two_zero(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2908, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_two_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2908, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_315is_two_zero, 0, __pyx_n_s_is_two_zero, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__377)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_two_zero, __pyx_t_41) < 0) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_two_zero, 2908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(0, 2908, __pyx_L1_error)
 2909:     """
 2910:     returns True if gen is a two_zero.
 2911:     
 2912:     :param gen: gen
 2913:     :rtype: bool
 2914:     """
+2915:     return cclm.mus_is_two_zero(gen._ptr)
  __pyx_r = mus_is_two_zero(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2916: 
 2917: 
 2918: 
 2919: 
 2920: # ---------------- formant ---------------- #
+2921: cpdef mus_any make_formant(frequency: float, radius: float):
static PyObject *__pyx_pw_8pysndlib_3clm_317make_formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_formant(double __pyx_v_frequency, double __pyx_v_radius, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_formant", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_317make_formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_316make_formant, "\n    return a new formant generator (a resonator). radius sets the pole radius (in terms of the 'unit circle').\n    frequency sets the resonance center frequency (hz).\n    \n    :param frequency: resonance center frequency \\in Hz\n    :param radius: resonance width, refers to the unit circle, so it should be between 0.0 and (less than) 1.0. \n    :return: formant gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_317make_formant = {"make_formant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_317make_formant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_316make_formant};
static PyObject *__pyx_pw_8pysndlib_3clm_317make_formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  double __pyx_v_radius;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_formant (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_radius,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2921, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2921, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_formant", 1, 2, 2, 1); __PYX_ERR(0, 2921, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_formant") < 0)) __PYX_ERR(0, 2921, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2921, __pyx_L3_error)
    __pyx_v_radius = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_radius == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2921, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_formant", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2921, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_316make_formant(__pyx_self, __pyx_v_frequency, __pyx_v_radius);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_316make_formant(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, double __pyx_v_radius) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_formant", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_formant(__pyx_v_frequency, __pyx_v_radius, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__378 = PyTuple_Pack(2, __pyx_n_s_frequency, __pyx_n_s_radius); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(0, 2921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 2921, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_radius, __pyx_n_s_float) < 0) __PYX_ERR(0, 2921, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_317make_formant, 0, __pyx_n_s_make_formant, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__379)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_formant, __pyx_t_40) < 0) __PYX_ERR(0, 2921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_formant, 2921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) __PYX_ERR(0, 2921, __pyx_L1_error)
 2922:     """
 2923:     return a new formant generator (a resonator). radius sets the pole radius (in terms of the 'unit circle').
 2924:     frequency sets the resonance center frequency (hz).
 2925:     
 2926:     :param frequency: resonance center frequency \in Hz
 2927:     :param radius: resonance width, refers to the unit circle, so it should be between 0.0 and (less than) 1.0. 
 2928:     :return: formant gen
 2929:     :rtype: mus_any
 2930:     """
+2931:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2931, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 2932: 
+2933:     return mus_any.from_ptr(cclm.mus_make_formant(frequency, radius))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_formant(__pyx_v_frequency, __pyx_v_radius), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 2934: 
+2935: cpdef cython.double formant(gen: mus_any, insig: float, radians: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_319formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_formant(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_formant *__pyx_optional_args) {
  PyObject *__pyx_v_radians = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formant", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_radians = __pyx_optional_args->radians;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_319formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_318formant, "\n    next sample from formant generator.\n    \n    :param gen: formant gen\n    :param insig: input value\n    :param radians: frequency \\in radians\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_319formant = {"formant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_319formant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_318formant};
static PyObject *__pyx_pw_8pysndlib_3clm_319formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_radians = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formant (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_radians,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2935, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2935, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("formant", 0, 2, 3, 1); __PYX_ERR(0, 2935, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radians);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2935, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "formant") < 0)) __PYX_ERR(0, 2935, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2935, __pyx_L3_error)
    __pyx_v_radians = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("formant", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2935, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2935, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_318formant(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_radians);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_318formant(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_radians) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formant", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.radians = __pyx_v_radians;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_formant(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2935, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__380 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_insig, __pyx_n_s_radians); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 2935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_radians, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 2935, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_319formant, 0, __pyx_n_s_formant, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__381)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_formant, __pyx_t_41) < 0) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_formant, 2935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) __PYX_ERR(0, 2935, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_formant {
  int __pyx_n;
  PyObject *radians;
};
 2936:     """
 2937:     next sample from formant generator.
 2938:     
 2939:     :param gen: formant gen
 2940:     :param insig: input value
 2941:     :param radians: frequency \in radians
 2942:     :rtype: float
 2943:     
 2944:     """
+2945:     if radians:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2945, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+2946:         return cclm.mus_formant_with_frequency(gen._ptr, insig, radians)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_radians); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2946, __pyx_L1_error)
    __pyx_r = mus_formant_with_frequency(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 2947:     else:
+2948:         return cclm.mus_formant(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_formant(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 2949: 
+2950: cpdef bint is_formant(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_321is_formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_formant(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_formant", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_321is_formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_320is_formant, "\n    returns True if gen is a formant.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_321is_formant = {"is_formant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_321is_formant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_320is_formant};
static PyObject *__pyx_pw_8pysndlib_3clm_321is_formant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_formant (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2950, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_formant") < 0)) __PYX_ERR(0, 2950, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_formant", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2950, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2950, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_320is_formant(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_320is_formant(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_formant", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_formant(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2950, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_formant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2950, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_321is_formant, 0, __pyx_n_s_is_formant, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_formant, __pyx_t_40) < 0) __PYX_ERR(0, 2950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_formant, 2950, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 2950, __pyx_L1_error)
 2951:     """
 2952:     returns True if gen is a formant.
 2953:     
 2954:     :param gen: gen
 2955:     :rtype: bool
 2956:     """
+2957:     return cclm.mus_is_formant(gen._ptr)
  __pyx_r = mus_is_formant(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 2958: 
 2959: # ---------------- formant-bank ---------------- #   
+2960: cpdef mus_any make_formant_bank(filters: list, amps=None):
static PyObject *__pyx_pw_8pysndlib_3clm_323make_formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_formant_bank(PyObject *__pyx_v_filters, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_formant_bank *__pyx_optional_args) {
  PyObject *__pyx_v_amps = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  __Pyx_memviewslice __pyx_v_amps_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_filt_array = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_formant_bank", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_amps = __pyx_optional_args->amps;
    }
  }
  __Pyx_INCREF(__pyx_v_amps);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_amps_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_filt_array);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_amps);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_323make_formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_322make_formant_bank, "\n    return a new formant-bank generator.\n    \n    :param filters: list of filter gens\n    :param amps: list of amps to apply to filters\n    :return: formant_bank gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_323make_formant_bank = {"make_formant_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_323make_formant_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_322make_formant_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_323make_formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filters = 0;
  PyObject *__pyx_v_amps = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_formant_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filters,&__pyx_n_s_amps,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filters)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2960, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amps);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2960, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_formant_bank") < 0)) __PYX_ERR(0, 2960, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filters = ((PyObject*)values[0]);
    __pyx_v_amps = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_formant_bank", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2960, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filters), (&PyList_Type), 0, "filters", 1))) __PYX_ERR(0, 2960, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_322make_formant_bank(__pyx_self, __pyx_v_filters, __pyx_v_amps);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_322make_formant_bank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filters, PyObject *__pyx_v_amps) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_formant_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.amps = __pyx_v_amps;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_formant_bank(__pyx_v_filters, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__383 = PyTuple_Pack(2, __pyx_n_s_filters, __pyx_n_s_amps); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_filters, __pyx_n_s_list) < 0) __PYX_ERR(0, 2960, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_323make_formant_bank, 0, __pyx_n_s_make_formant_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_formant_bank, __pyx_t_41) < 0) __PYX_ERR(0, 2960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_formant_bank, 2960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(0, 2960, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_formant_bank {
  int __pyx_n;
  PyObject *amps;
};
 2961:     """
 2962:     return a new formant-bank generator.
 2963:     
 2964:     :param filters: list of filter gens
 2965:     :param amps: list of amps to apply to filters
 2966:     :return: formant_bank gen
 2967:     :rtype: mus_any
 2968:     """
 2969: 
+2970:     p = list(map(is_formant, filters))
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_formant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_filters);
  __Pyx_GIVEREF(__pyx_v_filters);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_filters);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_p = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
 2971: 
+2972:     if not all(p):
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (unlikely(__pyx_t_4)) {
/* … */
  }
+2973:         raise TypeError(f'filter list contains at least one element that is not a formant.')
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2973, __pyx_L1_error)
/* … */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_filter_list_contains_at_least_on); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
 2974: 
+2975:     cdef double [:] amps_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __pyx_v_amps_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 2976: 
+2977:     filt_array = mus_any_array.from_pylist(filters)
  __pyx_t_2 = ((PyObject *)__pyx_f_8pysndlib_3clm_13mus_any_array_from_pylist(__pyx_v_filters)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_filt_array = ((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_t_2);
  __pyx_t_2 = 0;
 2978: 
+2979:     if amps is not None:
  __pyx_t_4 = (__pyx_v_amps != Py_None);
  if (__pyx_t_4) {
/* … */
    goto __pyx_L4;
  }
+2980:         if isinstance(amps, list):
    __pyx_t_4 = PyList_Check(__pyx_v_amps); 
    if (__pyx_t_4) {
/* … */
    }
+2981:             amps = np.array(amps)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2981, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2981, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_7 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_amps};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_amps, __pyx_t_2);
      __pyx_t_2 = 0;
+2982:         amps_view = amps
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_amps, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2982, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_amps_view, 1);
    __pyx_v_amps_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
+2983:         gen = mus_any.from_ptr(cclm.mus_make_formant_bank(len(filters),filt_array.data, &amps_view[0]))
    __pyx_t_8 = PyList_GET_SIZE(__pyx_v_filters); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2983, __pyx_L1_error)
    __pyx_t_9 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_v_amps_view.shape[0];
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_v_amps_view.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(0, 2983, __pyx_L1_error)
    }
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_formant_bank(__pyx_t_8, __pyx_v_filt_array->data, (&(*((double *) ( /* dim=0 */ (__pyx_v_amps_view.data + __pyx_t_9 * __pyx_v_amps_view.strides[0]) ))))), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
 2984:     else:
+2985:         gen = mus_any.from_ptr(cclm.mus_make_formant_bank(len(filters),filt_array.data, NULL))
  /*else*/ {
    __pyx_t_8 = PyList_GET_SIZE(__pyx_v_filters); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2985, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_formant_bank(__pyx_t_8, __pyx_v_filt_array->data, NULL), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;
+2986:     gen.cache_extend([filt_array, amps, filters])
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_filt_array);
  __Pyx_GIVEREF((PyObject *)__pyx_v_filt_array);
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_filt_array));
  __Pyx_INCREF(__pyx_v_amps);
  __Pyx_GIVEREF(__pyx_v_amps);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_amps);
  __Pyx_INCREF(__pyx_v_filters);
  __Pyx_GIVEREF(__pyx_v_filters);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_v_filters);
  __pyx_t_6 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+2987:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 2988: 
 2989: 
+2990: cpdef cython.double formant_bank(gen: mus_any, inputs):
static PyObject *__pyx_pw_8pysndlib_3clm_325formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_formant_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_inputs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_inputs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_res = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formant_bank", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_inputs_view, 1);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_325formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_324formant_bank, "\n    sum a bank of formant generators.\n    \n    :param gen: formant_bank gen\n    :param inputs: can be a list/array of inputs or a single input\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_325formant_bank = {"formant_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_325formant_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_324formant_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_325formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_inputs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formant_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_inputs,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2990, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inputs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2990, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("formant_bank", 1, 2, 2, 1); __PYX_ERR(0, 2990, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "formant_bank") < 0)) __PYX_ERR(0, 2990, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_inputs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("formant_bank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2990, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 2990, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_324formant_bank(__pyx_self, __pyx_v_gen, __pyx_v_inputs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_324formant_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_inputs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formant_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_formant_bank(__pyx_v_gen, __pyx_v_inputs, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2990, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__385 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_inputs); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 2990, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_325formant_bank, 0, __pyx_n_s_formant_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_formant_bank, __pyx_t_40) < 0) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_formant_bank, 2990, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(0, 2990, __pyx_L1_error)
 2991:     """
 2992:     sum a bank of formant generators.
 2993:     
 2994:     :param gen: formant_bank gen
 2995:     :param inputs: can be a list/array of inputs or a single input
 2996:     :rtype: float
 2997:     
 2998:     """
 2999: 
+3000:     cdef double [:] inputs_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __pyx_v_inputs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3001: 
+3002:     if isinstance(inputs, np.ndarray):
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_inputs, __pyx_ptype_5numpy_ndarray); 
  if (__pyx_t_2) {
/* … */
  }
+3003:         inputs_view = inputs
    __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_inputs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3003, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_inputs_view, 1);
    __pyx_v_inputs_view = __pyx_t_1;
    __pyx_t_1.memview = NULL;
    __pyx_t_1.data = NULL;
+3004:         res = cclm.mus_formant_bank_with_inputs(gen._ptr, &inputs_view[0])
    __pyx_t_3 = 0;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_v_inputs_view.shape[0];
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_v_inputs_view.shape[0])) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      __PYX_ERR(0, 3004, __pyx_L1_error)
    }
    __pyx_t_5 = PyFloat_FromDouble(mus_formant_bank_with_inputs(__pyx_v_gen->_ptr, (&(*((double *) ( /* dim=0 */ (__pyx_v_inputs_view.data + __pyx_t_3 * __pyx_v_inputs_view.strides[0]) )))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;
+3005:         return res
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_res); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3005, __pyx_L1_error)
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;
 3006:     else:
+3007:         res = cclm.mus_formant_bank(gen._ptr, inputs)
  /*else*/ {
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_inputs); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3007, __pyx_L1_error)
    __pyx_t_5 = PyFloat_FromDouble(mus_formant_bank(__pyx_v_gen->_ptr, __pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;
  }
+3008:     return res
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_res); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3008, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;
 3009: 
+3010: cpdef bint is_formant_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_327is_formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_formant_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_formant_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_327is_formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_326is_formant_bank, "\n    returns True if gen is a formant_bank.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_327is_formant_bank = {"is_formant_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_327is_formant_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_326is_formant_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_327is_formant_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_formant_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3010, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_formant_bank") < 0)) __PYX_ERR(0, 3010, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_formant_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3010, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3010, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_326is_formant_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_326is_formant_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_formant_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_formant_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3010, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_formant_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_327is_formant_bank, 0, __pyx_n_s_is_formant_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__387)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_formant_bank, __pyx_t_41) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_formant_bank, 3010, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) __PYX_ERR(0, 3010, __pyx_L1_error)
 3011:     """
 3012:     returns True if gen is a formant_bank.
 3013:     
 3014:     :param gen: gen
 3015:     :rtype: bool
 3016:     """
+3017:     return cclm.mus_is_formant_bank(gen._ptr)
  __pyx_r = mus_is_formant_bank(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3018: 
 3019: # ---------------- firmant ---------------- #
+3020: cpdef mus_any make_firmant(frequency: float, radius: float):
static PyObject *__pyx_pw_8pysndlib_3clm_329make_firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_firmant(double __pyx_v_frequency, double __pyx_v_radius, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_firmant", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.make_firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_329make_firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_328make_firmant, "\n    return a new firmant generator (a resonator).  radius sets the pole radius (in terms of the 'unit\n    circle'). frequency sets the resonance center frequency (hz).\n    \n    :param frequency: resonance center frequency \\in Hz\n    :param radius: resonance width, refers to the unit circle, so it should be between 0.0 and (less than) 1.0. \n    :return: formant gen\n    :rtype: mus_any       \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_329make_firmant = {"make_firmant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_329make_firmant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_328make_firmant};
static PyObject *__pyx_pw_8pysndlib_3clm_329make_firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  double __pyx_v_radius;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_firmant (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_radius,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3020, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3020, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_firmant", 1, 2, 2, 1); __PYX_ERR(0, 3020, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_firmant") < 0)) __PYX_ERR(0, 3020, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3020, __pyx_L3_error)
    __pyx_v_radius = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_radius == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3020, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_firmant", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3020, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_328make_firmant(__pyx_self, __pyx_v_frequency, __pyx_v_radius);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_328make_firmant(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, double __pyx_v_radius) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_firmant", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_firmant(__pyx_v_frequency, __pyx_v_radius, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 3020, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_radius, __pyx_n_s_float) < 0) __PYX_ERR(0, 3020, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_329make_firmant, 0, __pyx_n_s_make_firmant, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_firmant, __pyx_t_40) < 0) __PYX_ERR(0, 3020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_firmant, 3020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(0, 3020, __pyx_L1_error)
 3021:     """
 3022:     return a new firmant generator (a resonator).  radius sets the pole radius (in terms of the 'unit
 3023:     circle'). frequency sets the resonance center frequency (hz).
 3024:     
 3025:     :param frequency: resonance center frequency \in Hz
 3026:     :param radius: resonance width, refers to the unit circle, so it should be between 0.0 and (less than) 1.0. 
 3027:     :return: formant gen
 3028:     :rtype: mus_any       
 3029:     """
+3030:     check_range('frequency', frequency, 0.0, get_srate() / 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8pysndlib_3clm_get_srate(0); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3030, __pyx_L1_error)
  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / 2.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3031: 
+3032:     return mus_any.from_ptr(cclm.mus_make_firmant(frequency, radius))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_firmant(__pyx_v_frequency, __pyx_v_radius), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 3033: 
+3034: cpdef firmant(gen: mus_any, insig: float, radians: Optional[float]=None ):
static PyObject *__pyx_pw_8pysndlib_3clm_331firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_firmant(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_firmant *__pyx_optional_args) {
  PyObject *__pyx_v_radians = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("firmant", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_radians = __pyx_optional_args->radians;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_331firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_330firmant, "\n    next sample from resonator generator.\n    \n    next sample from firmant generator.\n    :param gen: firmant gen\n    :param insig: input value\n    :param radians: frequency \\in radians\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_331firmant = {"firmant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_331firmant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_330firmant};
static PyObject *__pyx_pw_8pysndlib_3clm_331firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_radians = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("firmant (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_radians,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3034, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3034, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("firmant", 0, 2, 3, 1); __PYX_ERR(0, 3034, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radians);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3034, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "firmant") < 0)) __PYX_ERR(0, 3034, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3034, __pyx_L3_error)
    __pyx_v_radians = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("firmant", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3034, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3034, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_330firmant(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_radians);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_330firmant(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_radians) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("firmant", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.radians = __pyx_v_radians;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_firmant(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_radians, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_331firmant, 0, __pyx_n_s_firmant, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__389)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_firmant, __pyx_t_41) < 0) __PYX_ERR(0, 3034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_firmant, 3034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) __PYX_ERR(0, 3034, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_firmant {
  int __pyx_n;
  PyObject *radians;
};
 3035:     """
 3036:     next sample from resonator generator.
 3037:     
 3038:     next sample from firmant generator.
 3039:     :param gen: firmant gen
 3040:     :param insig: input value
 3041:     :param radians: frequency \in radians
 3042:     :rtype: float
 3043:     """
+3044:     if radians:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3044, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3045:         return cclm.mus_firmant_with_frequency(gen._ptr, insig, radians)
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_radians); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3045, __pyx_L1_error)
    __pyx_t_3 = PyFloat_FromDouble(mus_firmant_with_frequency(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
 3046:     else:
+3047:         return cclm.mus_firmant(gen._ptr, insig)
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyFloat_FromDouble(mus_firmant(__pyx_v_gen->_ptr, __pyx_v_insig)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
 3048: 
+3049: cpdef is_firmant(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_333is_firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_firmant(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_firmant", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_333is_firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_332is_firmant, "\n    returns True if gen is a firmant.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_333is_firmant = {"is_firmant", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_333is_firmant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_332is_firmant};
static PyObject *__pyx_pw_8pysndlib_3clm_333is_firmant(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_firmant (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3049, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_firmant") < 0)) __PYX_ERR(0, 3049, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_firmant", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3049, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3049, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_332is_firmant(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_332is_firmant(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_firmant", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_firmant(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_firmant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3049, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_333is_firmant, 0, __pyx_n_s_is_firmant, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_firmant, __pyx_t_40) < 0) __PYX_ERR(0, 3049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_firmant, 3049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(0, 3049, __pyx_L1_error)
 3050:     """
 3051:     returns True if gen is a firmant.
 3052:     
 3053:     :param gen: gen
 3054:     :rtype: bool
 3055:     """
+3056:     return cclm.mus_is_firmant(gen._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(mus_is_firmant(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 3057: 
 3058: # ---------------- filter ---------------- #
+3059: cpdef mus_any make_filter(order: int, xcoeffs, ycoeffs):
static PyObject *__pyx_pw_8pysndlib_3clm_335make_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_filter(PyObject *__pyx_v_order, PyObject *__pyx_v_xcoeffs, PyObject *__pyx_v_ycoeffs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_xcoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_ycoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filter", 0);
  __Pyx_INCREF(__pyx_v_xcoeffs);
  __Pyx_INCREF(__pyx_v_ycoeffs);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysndlib.clm.make_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xcoeffs_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ycoeffs_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_xcoeffs);
  __Pyx_XDECREF(__pyx_v_ycoeffs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_335make_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_334make_filter, "\n    return a new direct form fir/iir filter, coeff args are list/ndarray.\n    \n    :param order: filter order\n    :param xcoeffs: x coeffs\n    :param ycoeffs: y coeffs\n    :return: filter gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_335make_filter = {"make_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_335make_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_334make_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_335make_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_xcoeffs = 0;
  PyObject *__pyx_v_ycoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_xcoeffs,&__pyx_n_s_ycoeffs,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3059, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xcoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3059, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_filter", 1, 3, 3, 1); __PYX_ERR(0, 3059, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ycoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3059, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_filter", 1, 3, 3, 2); __PYX_ERR(0, 3059, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_filter") < 0)) __PYX_ERR(0, 3059, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_order = ((PyObject*)values[0]);
    __pyx_v_xcoeffs = values[1];
    __pyx_v_ycoeffs = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_filter", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3059, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyInt_Type), 0, "order", 1))) __PYX_ERR(0, 3059, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_334make_filter(__pyx_self, __pyx_v_order, __pyx_v_xcoeffs, __pyx_v_ycoeffs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_334make_filter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_order, PyObject *__pyx_v_xcoeffs, PyObject *__pyx_v_ycoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_filter(__pyx_v_order, __pyx_v_xcoeffs, __pyx_v_ycoeffs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__391 = PyTuple_Pack(3, __pyx_n_s_order, __pyx_n_s_xcoeffs, __pyx_n_s_ycoeffs); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__391);
  __Pyx_GIVEREF(__pyx_tuple__391);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_order, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3059, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_335make_filter, 0, __pyx_n_s_make_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_filter, __pyx_t_41) < 0) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_filter, 3059, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(0, 3059, __pyx_L1_error)
 3060:     """
 3061:     return a new direct form fir/iir filter, coeff args are list/ndarray.
 3062:     
 3063:     :param order: filter order
 3064:     :param xcoeffs: x coeffs
 3065:     :param ycoeffs: y coeffs
 3066:     :return: filter gen
 3067:     :rtype: mus_any
 3068:     """
+3069:     cdef double [:] xcoeffs_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3069, __pyx_L1_error)
  __pyx_v_xcoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
+3070:     cdef double [:] ycoeffs_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3070, __pyx_L1_error)
  __pyx_v_ycoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3071: 
+3072:     if isinstance(xcoeffs, list):
  __pyx_t_2 = PyList_Check(__pyx_v_xcoeffs); 
  if (__pyx_t_2) {
/* … */
  }
+3073:         xcoeffs = np.array(xcoeffs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_xcoeffs);
    __Pyx_GIVEREF(__pyx_v_xcoeffs);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xcoeffs);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_xcoeffs, __pyx_t_7);
    __pyx_t_7 = 0;
 3074: 
+3075:     if isinstance(ycoeffs, list):
  __pyx_t_2 = PyList_Check(__pyx_v_ycoeffs); 
  if (__pyx_t_2) {
/* … */
  }
+3076:         ycoeffs = np.array(ycoeffs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_ycoeffs);
    __Pyx_GIVEREF(__pyx_v_ycoeffs);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ycoeffs);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_ycoeffs, __pyx_t_6);
    __pyx_t_6 = 0;
 3077: 
+3078:     xcoeffs_view = xcoeffs
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_xcoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3078, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xcoeffs_view, 1);
  __pyx_v_xcoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
+3079:     ycoeffs_view = ycoeffs
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_ycoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3079, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ycoeffs_view, 1);
  __pyx_v_ycoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3080: 
+3081:     gen =  mus_any.from_ptr(cclm.mus_make_filter(order, &xcoeffs_view[0], &ycoeffs_view[0], NULL))
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_order); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3081, __pyx_L1_error)
  __pyx_t_9 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_v_xcoeffs_view.shape[0];
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_9 >= __pyx_v_xcoeffs_view.shape[0])) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    __PYX_ERR(0, 3081, __pyx_L1_error)
  }
  __pyx_t_11 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_ycoeffs_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_ycoeffs_view.shape[0])) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    __PYX_ERR(0, 3081, __pyx_L1_error)
  }
  __pyx_t_6 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_filter(__pyx_t_8, (&(*((double *) ( /* dim=0 */ (__pyx_v_xcoeffs_view.data + __pyx_t_9 * __pyx_v_xcoeffs_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_ycoeffs_view.data + __pyx_t_11 * __pyx_v_ycoeffs_view.strides[0]) )))), NULL), NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_6);
  __pyx_t_6 = 0;
 3082: 
+3083:     gen.cache_extend([xcoeffs, ycoeffs])
  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_xcoeffs);
  __Pyx_GIVEREF(__pyx_v_xcoeffs);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_xcoeffs);
  __Pyx_INCREF(__pyx_v_ycoeffs);
  __Pyx_GIVEREF(__pyx_v_ycoeffs);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_v_ycoeffs);
  __pyx_t_3 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_6, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+3084:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3085: 
+3086: cpdef cython.double filter(gen: mus_any, insig: float): # todo : conflicts with buitl in function
static PyObject *__pyx_pw_8pysndlib_3clm_337filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_337filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_336filter, "\n    next sample from filter.\n    \n    :param gen: filter gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_337filter = {"filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_337filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_336filter};
static PyObject *__pyx_pw_8pysndlib_3clm_337filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3086, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3086, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("filter", 1, 2, 2, 1); __PYX_ERR(0, 3086, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filter") < 0)) __PYX_ERR(0, 3086, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3086, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3086, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3086, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_336filter(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_336filter(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_filter(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3086, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3086, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3086, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_337filter, 0, __pyx_n_s_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__393)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_filter, __pyx_t_40) < 0) __PYX_ERR(0, 3086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_filter, 3086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) __PYX_ERR(0, 3086, __pyx_L1_error)
 3087:     """
 3088:     next sample from filter.
 3089:     
 3090:     :param gen: filter gen
 3091:     :param insig: input value
 3092:     :rtype: float
 3093:     """
+3094:     return cclm.mus_filter(gen._ptr, insig)
  __pyx_r = mus_filter(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3095: 
+3096: cpdef bint is_filter(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_339is_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_339is_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_338is_filter, "\n    returns True if gen is a filter.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_339is_filter = {"is_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_339is_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_338is_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_339is_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3096, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_filter") < 0)) __PYX_ERR(0, 3096, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_filter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3096, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3096, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_338is_filter(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_338is_filter(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_filter(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3096, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3096, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_339is_filter, 0, __pyx_n_s_is_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_filter, __pyx_t_41) < 0) __PYX_ERR(0, 3096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_filter, 3096, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(0, 3096, __pyx_L1_error)
 3097:     """
 3098:     returns True if gen is a filter.
 3099:     
 3100:     :param gen: gen
 3101:     :rtype: bool
 3102:     """
+3103:     return cclm.mus_is_filter(gen._ptr)
  __pyx_r = mus_is_filter(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3104: 
 3105: # ---------------- fir-filter ---------------- #
+3106: cpdef mus_any make_fir_filter(order: int, xcoeffs):
static PyObject *__pyx_pw_8pysndlib_3clm_341make_fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_fir_filter(PyObject *__pyx_v_order, PyObject *__pyx_v_xcoeffs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_xcoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fir_filter", 0);
  __Pyx_INCREF(__pyx_v_xcoeffs);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysndlib.clm.make_fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xcoeffs_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_xcoeffs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_341make_fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_340make_fir_filter, "\n    return a new fir filter, xcoeffs a list/ndarray.\n    \n    :param order: filter order\n    :param xcoeffs: x coeffs\n    :return: fir_filter gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_341make_fir_filter = {"make_fir_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_341make_fir_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_340make_fir_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_341make_fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_xcoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fir_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_xcoeffs,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3106, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xcoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3106, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_fir_filter", 1, 2, 2, 1); __PYX_ERR(0, 3106, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_fir_filter") < 0)) __PYX_ERR(0, 3106, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_order = ((PyObject*)values[0]);
    __pyx_v_xcoeffs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_fir_filter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3106, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyInt_Type), 0, "order", 1))) __PYX_ERR(0, 3106, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_340make_fir_filter(__pyx_self, __pyx_v_order, __pyx_v_xcoeffs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_340make_fir_filter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_order, PyObject *__pyx_v_xcoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fir_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_fir_filter(__pyx_v_order, __pyx_v_xcoeffs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__395 = PyTuple_Pack(2, __pyx_n_s_order, __pyx_n_s_xcoeffs); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_order, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3106, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_341make_fir_filter, 0, __pyx_n_s_make_fir_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_fir_filter, __pyx_t_40) < 0) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_fir_filter, 3106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(0, 3106, __pyx_L1_error)
 3107:     """
 3108:     return a new fir filter, xcoeffs a list/ndarray.
 3109:     
 3110:     :param order: filter order
 3111:     :param xcoeffs: x coeffs
 3112:     :return: fir_filter gen
 3113:     :rtype: mus_any
 3114:     """
+3115:     cdef double [:] xcoeffs_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3115, __pyx_L1_error)
  __pyx_v_xcoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3116: 
+3117:     if isinstance(xcoeffs, list):
  __pyx_t_2 = PyList_Check(__pyx_v_xcoeffs); 
  if (__pyx_t_2) {
/* … */
  }
+3118:         xcoeffs = np.array(xcoeffs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_xcoeffs);
    __Pyx_GIVEREF(__pyx_v_xcoeffs);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xcoeffs);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_xcoeffs, __pyx_t_7);
    __pyx_t_7 = 0;
 3119: 
+3120:     xcoeffs_view = xcoeffs
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_xcoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3120, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_xcoeffs_view, 1);
  __pyx_v_xcoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3121: 
+3122:     gen =  mus_any.from_ptr(cclm.mus_make_fir_filter(order, &xcoeffs_view[0], NULL))
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_order); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3122, __pyx_L1_error)
  __pyx_t_9 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_v_xcoeffs_view.shape[0];
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_9 >= __pyx_v_xcoeffs_view.shape[0])) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    __PYX_ERR(0, 3122, __pyx_L1_error)
  }
  __pyx_t_7 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_fir_filter(__pyx_t_8, (&(*((double *) ( /* dim=0 */ (__pyx_v_xcoeffs_view.data + __pyx_t_9 * __pyx_v_xcoeffs_view.strides[0]) )))), NULL), NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_7);
  __pyx_t_7 = 0;
+3123:     gen.cache_append(xcoeffs)
  __pyx_t_7 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_xcoeffs, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 3124: 
+3125:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3126: 
+3127: cpdef cython.double fir_filter(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_343fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_fir_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fir_filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_343fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_342fir_filter, "\n    next sample from fir filter.\n    \n    :param gen: fir_filter gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_343fir_filter = {"fir_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_343fir_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_342fir_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_343fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fir_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3127, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3127, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fir_filter", 1, 2, 2, 1); __PYX_ERR(0, 3127, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fir_filter") < 0)) __PYX_ERR(0, 3127, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3127, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fir_filter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3127, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3127, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_342fir_filter(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_342fir_filter(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fir_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_fir_filter(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3127, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3127, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3127, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_343fir_filter, 0, __pyx_n_s_fir_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__397)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fir_filter, __pyx_t_41) < 0) __PYX_ERR(0, 3127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_fir_filter, 3127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) __PYX_ERR(0, 3127, __pyx_L1_error)
 3128:     """
 3129:     next sample from fir filter.
 3130:     
 3131:     :param gen: fir_filter gen
 3132:     :param insig: input value
 3133:     :rtype: float
 3134:     """
+3135:     return cclm.mus_fir_filter(gen._ptr, insig)
  __pyx_r = mus_fir_filter(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3136: 
+3137: cpdef bint is_fir_filter(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_345is_fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_fir_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_fir_filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_345is_fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_344is_fir_filter, "\n    returns True if gen is a fir_filter.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_345is_fir_filter = {"is_fir_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_345is_fir_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_344is_fir_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_345is_fir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_fir_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3137, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_fir_filter") < 0)) __PYX_ERR(0, 3137, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_fir_filter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3137, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3137, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_344is_fir_filter(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_344is_fir_filter(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_fir_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_fir_filter(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3137, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_fir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3137, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_345is_fir_filter, 0, __pyx_n_s_is_fir_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__398)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_fir_filter, __pyx_t_40) < 0) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_fir_filter, 3137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(0, 3137, __pyx_L1_error)
 3138:     """
 3139:     returns True if gen is a fir_filter.
 3140:     
 3141:     :param gen: gen
 3142:     :rtype: bool
 3143:     """
+3144:     return cclm.mus_is_fir_filter(gen._ptr)
  __pyx_r = mus_is_fir_filter(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3145: 
 3146: 
 3147: # ---------------- iir-filter ---------------- #
+3148: cpdef mus_any make_iir_filter(order: int, ycoeffs):
static PyObject *__pyx_pw_8pysndlib_3clm_347make_iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_iir_filter(PyObject *__pyx_v_order, PyObject *__pyx_v_ycoeffs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_ycoeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_iir_filter", 0);
  __Pyx_INCREF(__pyx_v_ycoeffs);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysndlib.clm.make_iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ycoeffs_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_ycoeffs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_347make_iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_346make_iir_filter, "\n    return a new iir filter, ycoeffs a list/ndarray.\n    \n    :param order: filter order\n    :param ycoeffs: y coeffs\n    :return: iir_filter gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_347make_iir_filter = {"make_iir_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_347make_iir_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_346make_iir_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_347make_iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_ycoeffs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_iir_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_ycoeffs,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3148, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ycoeffs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3148, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_iir_filter", 1, 2, 2, 1); __PYX_ERR(0, 3148, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_iir_filter") < 0)) __PYX_ERR(0, 3148, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_order = ((PyObject*)values[0]);
    __pyx_v_ycoeffs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_iir_filter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3148, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyInt_Type), 0, "order", 1))) __PYX_ERR(0, 3148, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_346make_iir_filter(__pyx_self, __pyx_v_order, __pyx_v_ycoeffs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_346make_iir_filter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_order, PyObject *__pyx_v_ycoeffs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_iir_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_iir_filter(__pyx_v_order, __pyx_v_ycoeffs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__399 = PyTuple_Pack(2, __pyx_n_s_order, __pyx_n_s_ycoeffs); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__399);
  __Pyx_GIVEREF(__pyx_tuple__399);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_order, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3148, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_347make_iir_filter, 0, __pyx_n_s_make_iir_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__400)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_iir_filter, __pyx_t_41) < 0) __PYX_ERR(0, 3148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_iir_filter, 3148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(0, 3148, __pyx_L1_error)
 3149:     """
 3150:     return a new iir filter, ycoeffs a list/ndarray.
 3151:     
 3152:     :param order: filter order
 3153:     :param ycoeffs: y coeffs
 3154:     :return: iir_filter gen
 3155:     :rtype: mus_any
 3156:     """
+3157:     cdef double [:] ycoeffs_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3157, __pyx_L1_error)
  __pyx_v_ycoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3158: 
+3159:     if isinstance(ycoeffs, list):
  __pyx_t_2 = PyList_Check(__pyx_v_ycoeffs); 
  if (__pyx_t_2) {
/* … */
  }
+3160:         ycoeffs = np.array(ycoeffs, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_ycoeffs);
    __Pyx_GIVEREF(__pyx_v_ycoeffs);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ycoeffs);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_ycoeffs, __pyx_t_7);
    __pyx_t_7 = 0;
 3161: 
+3162:     ycoeffs_view = ycoeffs
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_ycoeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3162, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_ycoeffs_view, 1);
  __pyx_v_ycoeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3163: 
 3164: 
+3165:     gen = mus_any.from_ptr(cclm.mus_make_iir_filter(order, &ycoeffs_view[0], NULL))
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_order); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3165, __pyx_L1_error)
  __pyx_t_9 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_v_ycoeffs_view.shape[0];
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_9 >= __pyx_v_ycoeffs_view.shape[0])) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    __PYX_ERR(0, 3165, __pyx_L1_error)
  }
  __pyx_t_7 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_iir_filter(__pyx_t_8, (&(*((double *) ( /* dim=0 */ (__pyx_v_ycoeffs_view.data + __pyx_t_9 * __pyx_v_ycoeffs_view.strides[0]) )))), NULL), NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_7);
  __pyx_t_7 = 0;
+3166:     gen.cache_append(ycoeffs)
  __pyx_t_7 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_ycoeffs, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+3167:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3168: 
+3169: cpdef cython.double iir_filter(gen: mus_any, insig: float ):
static PyObject *__pyx_pw_8pysndlib_3clm_349iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_iir_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iir_filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_349iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_348iir_filter, "\n    next sample from iir filter.\n    \n    :param gen: iir_filter gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_349iir_filter = {"iir_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_349iir_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_348iir_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_349iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iir_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3169, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3169, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("iir_filter", 1, 2, 2, 1); __PYX_ERR(0, 3169, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iir_filter") < 0)) __PYX_ERR(0, 3169, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3169, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("iir_filter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3169, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3169, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_348iir_filter(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_348iir_filter(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iir_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_iir_filter(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3169, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3169, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_349iir_filter, 0, __pyx_n_s_iir_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__401)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iir_filter, __pyx_t_40) < 0) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_iir_filter, 3169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) __PYX_ERR(0, 3169, __pyx_L1_error)
 3170:     """
 3171:     next sample from iir filter.
 3172:     
 3173:     :param gen: iir_filter gen
 3174:     :param insig: input value
 3175:     :rtype: float
 3176:     """
+3177:     return cclm.mus_iir_filter(gen._ptr, insig)
  __pyx_r = mus_iir_filter(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3178: 
+3179: cpdef bint is_iir_filter(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_351is_iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_iir_filter(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_iir_filter", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_351is_iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_350is_iir_filter, "\n    returns True if gen is a iir_filter\n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_351is_iir_filter = {"is_iir_filter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_351is_iir_filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_350is_iir_filter};
static PyObject *__pyx_pw_8pysndlib_3clm_351is_iir_filter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_iir_filter (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3179, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_iir_filter") < 0)) __PYX_ERR(0, 3179, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_iir_filter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3179, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3179, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_350is_iir_filter(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_350is_iir_filter(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_iir_filter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_iir_filter(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3179, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_iir_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3179, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_351is_iir_filter, 0, __pyx_n_s_is_iir_filter, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__402)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_iir_filter, __pyx_t_41) < 0) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_iir_filter, 3179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(0, 3179, __pyx_L1_error)
 3180:     """
 3181:     returns True if gen is a iir_filter
 3182:     :param gen: gen
 3183:     :rtype: bool
 3184:     """
+3185:     return cclm.mus_is_iir_filter(gen._ptr)
  __pyx_r = mus_is_iir_filter(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3186: 
+3187: cpdef np.ndarray make_fir_coeffs(order: int, envelope):
static PyObject *__pyx_pw_8pysndlib_3clm_353make_fir_coeffs(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_make_fir_coeffs(PyObject *__pyx_v_order, PyObject *__pyx_v_envelope, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_envelope_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_coeffs = NULL;
  __Pyx_memviewslice __pyx_v_coeffs_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fir_coeffs", 0);
  __Pyx_INCREF(__pyx_v_envelope);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.make_fir_coeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_envelope_view, 1);
  __Pyx_XDECREF(__pyx_v_coeffs);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_coeffs_view, 1);
  __Pyx_XDECREF(__pyx_v_envelope);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_353make_fir_coeffs(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_352make_fir_coeffs, "\n    translates a frequency response envelope (actually, evenly spaced points \\in a float-vector) into\n    the corresponding FIR filter coefficients. The order of the filter determines how close you get to the\n    envelope.\n    \n    :param order: order of the filter\n    :param envelope: response envelope\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_353make_fir_coeffs = {"make_fir_coeffs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_353make_fir_coeffs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_352make_fir_coeffs};
static PyObject *__pyx_pw_8pysndlib_3clm_353make_fir_coeffs(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_envelope = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fir_coeffs (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_envelope,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3187, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_envelope)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3187, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_fir_coeffs", 1, 2, 2, 1); __PYX_ERR(0, 3187, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_fir_coeffs") < 0)) __PYX_ERR(0, 3187, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_order = ((PyObject*)values[0]);
    __pyx_v_envelope = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_fir_coeffs", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3187, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_fir_coeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyInt_Type), 0, "order", 1))) __PYX_ERR(0, 3187, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_352make_fir_coeffs(__pyx_self, __pyx_v_order, __pyx_v_envelope);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_352make_fir_coeffs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_order, PyObject *__pyx_v_envelope) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fir_coeffs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_fir_coeffs(__pyx_v_order, __pyx_v_envelope, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_fir_coeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__403 = PyTuple_Pack(2, __pyx_n_s_order, __pyx_n_s_envelope); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(0, 3187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__403);
  __Pyx_GIVEREF(__pyx_tuple__403);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_order, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3187, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_353make_fir_coeffs, 0, __pyx_n_s_make_fir_coeffs, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__404)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_fir_coeffs, __pyx_t_40) < 0) __PYX_ERR(0, 3187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_fir_coeffs, 3187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(0, 3187, __pyx_L1_error)
 3188:     """
 3189:     translates a frequency response envelope (actually, evenly spaced points \in a float-vector) into
 3190:     the corresponding FIR filter coefficients. The order of the filter determines how close you get to the
 3191:     envelope.
 3192:     
 3193:     :param order: order of the filter
 3194:     :param envelope: response envelope
 3195:     """
+3196:     cdef double [:] envelope_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3196, __pyx_L1_error)
  __pyx_v_envelope_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3197: 
+3198:     if isinstance(envelope, list):
  __pyx_t_2 = PyList_Check(__pyx_v_envelope); 
  if (__pyx_t_2) {
/* … */
  }
+3199:         envelope = np.ndarray(envelope)
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_ndarray), __pyx_v_envelope); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_envelope, __pyx_t_3);
    __pyx_t_3 = 0;
 3200: 
+3201:     check_ndim(envelope)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_envelope};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 3202: 
+3203:     envelope_view = envelope
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_envelope, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3203, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_envelope_view, 1);
  __pyx_v_envelope_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3204: 
+3205:     coeffs = np.zeros(order+1, dtype=np.double)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_v_order, __pyx_int_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_coeffs = __pyx_t_8;
  __pyx_t_8 = 0;
 3206: 
+3207:     cdef double [:] coeffs_view = coeffs
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_coeffs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 3207, __pyx_L1_error)
  __pyx_v_coeffs_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 3208: 
+3209:     cclm.mus_make_fir_coeffs(order, &envelope_view[0], &coeffs_view[0])
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_order); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3209, __pyx_L1_error)
  __pyx_t_9 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_v_envelope_view.shape[0];
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_9 >= __pyx_v_envelope_view.shape[0])) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    __PYX_ERR(0, 3209, __pyx_L1_error)
  }
  __pyx_t_11 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_v_coeffs_view.shape[0];
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_v_coeffs_view.shape[0])) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    __PYX_ERR(0, 3209, __pyx_L1_error)
  }
  (void)(mus_make_fir_coeffs(__pyx_t_6, (&(*((double *) ( /* dim=0 */ (__pyx_v_envelope_view.data + __pyx_t_9 * __pyx_v_envelope_view.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_coeffs_view.data + __pyx_t_11 * __pyx_v_coeffs_view.strides[0]) ))))));
+3210:     return coeffs
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_coeffs) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coeffs, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3210, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_coeffs);
  __pyx_r = ((PyArrayObject *)__pyx_v_coeffs);
  goto __pyx_L0;
 3211: 
 3212: 
 3213: # ---------------- delay ---------------- #
+3214: cpdef mus_any make_delay(size: int,
static PyObject *__pyx_pw_8pysndlib_3clm_355make_delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_delay(PyObject *__pyx_v_size, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_delay *__pyx_optional_args) {
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysndlib.clm.make_delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XDECREF(__pyx_v_max_size);
  __Pyx_XDECREF(__pyx_v_interp_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_355make_delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_354make_delay, "\n    return a new delay line of size elements. if the delay length will be changing at run-time,\n    max-size sets its maximum length.\n    \n    :param size: delay length \\in samples\n    :param initial_contents: delay line's initial values\n    :param initial_element: delay line's initial element\n    :param max_size: maximum delay size \\in case the delay changes\n    :param type: interpolation type\n    :return: delay gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_355make_delay = {"make_delay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_355make_delay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_354make_delay};
static PyObject *__pyx_pw_8pysndlib_3clm_355make_delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  PyObject *__pyx_v_max_size = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_delay (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,&__pyx_n_s_max_size,&__pyx_n_s_interp_type,0};
    PyObject* values[5] = {0,0,0,0,0};
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_354make_delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element, PyObject *__pyx_v_max_size, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_delay", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_2.max_size = __pyx_v_max_size;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_delay(__pyx_v_size, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__405 = PyTuple_Pack(5, __pyx_n_s_size, __pyx_n_s_initial_contents, __pyx_n_s_initial_element, __pyx_n_s_max_size, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__405);
  __Pyx_GIVEREF(__pyx_tuple__405);
/* … */
  __pyx_t_41 = PyTuple_New(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 0, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 1, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 2, Py_None);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_41, 3, __pyx_t_40);
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_initial_element, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_max_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_355make_delay, 0, __pyx_n_s_make_delay, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__406)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_delay, __pyx_t_37) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_delay, 3214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(0, 3214, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_delay {
  int __pyx_n;
  PyObject *initial_contents;
  PyObject *initial_element;
  PyObject *max_size;
  PyObject *interp_type;
};
+3215:                 initial_contents=None,
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
/* … */
    values[1] = ((PyObject *)Py_None);
+3216:                 initial_element: Optional[float]=None,
  PyObject *__pyx_v_initial_element = ((PyObject *)Py_None);
/* … */
    values[2] = ((PyObject *)Py_None);
+3217:                 max_size:Optional[int]=None,
  PyObject *__pyx_v_max_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_interp_type = __pyx_k__38;
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_delay", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_element = __pyx_optional_args->initial_element;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_size = __pyx_optional_args->max_size;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_interp_type = __pyx_optional_args->interp_type;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
  __Pyx_INCREF(__pyx_v_max_size);
  __Pyx_INCREF(__pyx_v_interp_type);
/* … */
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k__38;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3214, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3214, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3214, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_size);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3214, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3214, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_delay") < 0)) __PYX_ERR(0, 3214, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = ((PyObject*)values[0]);
    __pyx_v_initial_contents = values[1];
    __pyx_v_initial_element = values[2];
    __pyx_v_max_size = values[3];
    __pyx_v_interp_type = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_delay", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 3214, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3214, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_354make_delay(__pyx_self, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_initial_element, __pyx_v_max_size, __pyx_v_interp_type);
+3218:                 interp_type=Interp.NONE):
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_k__38 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
/* … */
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
 3219:     """
 3220:     return a new delay line of size elements. if the delay length will be changing at run-time,
 3221:     max-size sets its maximum length.
 3222:     
 3223:     :param size: delay length \in samples
 3224:     :param initial_contents: delay line's initial values
 3225:     :param initial_element: delay line's initial element
 3226:     :param max_size: maximum delay size \in case the delay changes
 3227:     :param type: interpolation type
 3228:     :return: delay gen
 3229:     :rtype: mus_any
 3230:     """
 3231: 
+3232:     check_range('size', size, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3233: 
+3234:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3234, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3235: 
+3236:     if not max_size:
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_max_size); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3236, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {
/* … */
  }
+3237:         max_size = size
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_DECREF_SET(__pyx_v_max_size, __pyx_v_size);
 3238: 
+3239:     if max_size != size and interp_type == Interp.NONE:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_max_size, __pyx_v_size, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_7 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_interp_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_7) {
/* … */
  }
+3240:         interp_type = Interp.LAGRANGE #think this is correct from clm2xen.c
    __pyx_t_2 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LAGRANGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_interp_type, __pyx_t_2);
    __pyx_t_2 = 0;
 3241: 
+3242:     if initial_contents is not None:
  __pyx_t_7 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L7;
  }
+3243:         if isinstance(initial_contents, list):
    __pyx_t_7 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_7) {
/* … */
    }
+3244:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
      __pyx_t_2 = 0;
+3245:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3246:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3246, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3247: 
+3248:     elif initial_element:
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_initial_element); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 3248, __pyx_L1_error)
  if (__pyx_t_7) {
/* … */
  }
  __pyx_L7:;
+3249:         initial_contents = np.zeros(max_size, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_max_size);
    __Pyx_GIVEREF(__pyx_v_max_size);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_max_size);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_9);
    __pyx_t_9 = 0;
+3250:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3251:         initial_contents.fill(initial_element)
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_element};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3252:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3252, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3253: 
+3254:     if initial_contents_view is not None:
  __pyx_t_7 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L9;
  }
+3255:         gen = mus_any.from_ptr(cclm.mus_make_delay(size, &initial_contents_view[0], max_size, interp_type))
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3255, __pyx_L1_error)
    __pyx_t_10 = 0;
    __pyx_t_11 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      __PYX_ERR(0, 3255, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3255, __pyx_L1_error)
    __pyx_t_12 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3255, __pyx_L1_error)
    __pyx_t_9 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_delay(__pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_10 * __pyx_v_initial_contents_view.strides[0]) )))), __pyx_t_11, __pyx_t_12), NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_9);
    __pyx_t_9 = 0;
 3256:     else:
+3257:         gen = mus_any.from_ptr(cclm.mus_make_delay(size, NULL, max_size, interp_type))
  /*else*/ {
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3257, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3257, __pyx_L1_error)
    __pyx_t_12 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3257, __pyx_L1_error)
    __pyx_t_9 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_delay(__pyx_t_11, NULL, __pyx_t_4, __pyx_t_12), NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_9);
    __pyx_t_9 = 0;
  }
  __pyx_L9:;
 3258: 
+3259:     gen.cache_append(initial_contents)
  __pyx_t_9 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3260:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3261: 
+3262: cpdef cython.double delay(gen: mus_any, insig: float, pm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_357delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_delay(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_delay *__pyx_optional_args) {
  PyObject *__pyx_v_pm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delay", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_pm = __pyx_optional_args->pm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_357delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_356delay, "\n    delay val according to the delay line's length and pm ('phase-modulation').\n    if pm is greater than 0.0, the max-size argument used to create gen should have accommodated \n    its maximum value. \n    \n    :param gen: delay gen\n    :param insig: input value\n    :param pm: change \\in delay length size. can be + or -\n    :rtype: float\n\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_357delay = {"delay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_357delay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_356delay};
static PyObject *__pyx_pw_8pysndlib_3clm_357delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_pm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delay (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_pm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3262, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3262, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("delay", 0, 2, 3, 1); __PYX_ERR(0, 3262, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3262, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "delay") < 0)) __PYX_ERR(0, 3262, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3262, __pyx_L3_error)
    __pyx_v_pm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delay", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3262, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_356delay(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_pm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_356delay(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_pm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delay", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.pm = __pyx_v_pm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_delay(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3262, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__407 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_insig, __pyx_n_s_pm); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__407);
  __Pyx_GIVEREF(__pyx_tuple__407);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_pm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_357delay, 0, __pyx_n_s_delay, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_40) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_delay, 3262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(0, 3262, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_delay {
  int __pyx_n;
  PyObject *pm;
};
 3263:     """
 3264:     delay val according to the delay line's length and pm ('phase-modulation').
 3265:     if pm is greater than 0.0, the max-size argument used to create gen should have accommodated 
 3266:     its maximum value. 
 3267:     
 3268:     :param gen: delay gen
 3269:     :param insig: input value
 3270:     :param pm: change \in delay length size. can be + or -
 3271:     :rtype: float
 3272: 
 3273:     """
+3274:     if pm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3274, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3275:         return cclm.mus_delay(gen._ptr, insig, pm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3275, __pyx_L1_error)
    __pyx_r = mus_delay(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 3276:     else:
+3277:         return cclm.mus_delay_unmodulated(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_delay_unmodulated(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 3278: 
+3279: cpdef bint is_delay(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_359is_delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_delay(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_delay", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_359is_delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_358is_delay, "\n    returns True if gen is a delay.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_359is_delay = {"is_delay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_359is_delay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_358is_delay};
static PyObject *__pyx_pw_8pysndlib_3clm_359is_delay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_delay (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3279, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_delay") < 0)) __PYX_ERR(0, 3279, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_delay", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3279, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3279, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_358is_delay(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_358is_delay(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_delay", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_delay(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3279, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_delay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3279, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_359is_delay, 0, __pyx_n_s_is_delay, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__409)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_delay, __pyx_t_37) < 0) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__409 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_delay, 3279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__409)) __PYX_ERR(0, 3279, __pyx_L1_error)
 3280:     """
 3281:     returns True if gen is a delay.
 3282:     
 3283:     :param gen: gen
 3284:     :rtype: bool
 3285:     """
+3286:     return cclm.mus_is_delay(gen._ptr)
  __pyx_r = mus_is_delay(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3287: 
+3288: cpdef cython.double tap(gen: mus_any, offset: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_361tap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_tap(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_tap *__pyx_optional_args) {
  PyObject *__pyx_v_offset = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tap", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.tap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_361tap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_360tap, "\n    tap the delay mus_any offset by pm\n    \n    :param gen: delay gen\n    :param offset: offset in samples from output point\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_361tap = {"tap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_361tap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_360tap};
static PyObject *__pyx_pw_8pysndlib_3clm_361tap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_offset = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tap (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_offset,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3288, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3288, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tap") < 0)) __PYX_ERR(0, 3288, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tap", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 3288, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.tap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3288, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_360tap(__pyx_self, __pyx_v_gen, __pyx_v_offset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_360tap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = __pyx_v_offset;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_tap(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3288, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.tap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__410 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__410);
  __Pyx_GIVEREF(__pyx_tuple__410);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_offset, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3288, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_361tap, 0, __pyx_n_s_tap, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__411)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tap, __pyx_t_40) < 0) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__411 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__410, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_tap, 3288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__411)) __PYX_ERR(0, 3288, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_tap {
  int __pyx_n;
  PyObject *offset;
};
 3289:     """
 3290:     tap the delay mus_any offset by pm
 3291:     
 3292:     :param gen: delay gen
 3293:     :param offset: offset in samples from output point
 3294:     :rtype: float
 3295:     
 3296:     """
+3297:     if offset:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_offset); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3297, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3298:         return cclm.mus_tap(gen._ptr, offset)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_offset); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3298, __pyx_L1_error)
    __pyx_r = mus_tap(__pyx_v_gen->_ptr, __pyx_t_2);
    goto __pyx_L0;
 3299:     else:
+3300:         return cclm.mus_tap_unmodulated(gen._ptr)
  /*else*/ {
    __pyx_r = mus_tap_unmodulated(__pyx_v_gen->_ptr);
    goto __pyx_L0;
  }
 3301: 
+3302: cpdef bint is_tap(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_363is_tap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_tap(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_tap", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_363is_tap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_362is_tap, "\n    returns True if gen is a tap.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_363is_tap = {"is_tap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_363is_tap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_362is_tap};
static PyObject *__pyx_pw_8pysndlib_3clm_363is_tap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_tap (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_tap") < 0)) __PYX_ERR(0, 3302, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_tap", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3302, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_tap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3302, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_362is_tap(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_362is_tap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_tap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_tap(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_tap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_363is_tap, 0, __pyx_n_s_is_tap, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__412)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_tap, __pyx_t_37) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_tap, 3302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) __PYX_ERR(0, 3302, __pyx_L1_error)
 3303:     """
 3304:     returns True if gen is a tap.
 3305:     
 3306:     :param gen: gen
 3307:     :rtype: bool
 3308:     """
+3309:     return cclm.mus_is_tap(gen._ptr)
  __pyx_r = mus_is_tap(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3310: 
+3311: cpdef cython.double delay_tick(gen: mus_any, insig: float ):
static PyObject *__pyx_pw_8pysndlib_3clm_365delay_tick(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_delay_tick(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delay_tick", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_365delay_tick(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_364delay_tick, "\n    delay val according to the delay line's length. this merely 'ticks' the delay line forward.\n    the argument 'insi' is returned.\n    \n    :param gen: delay gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_365delay_tick = {"delay_tick", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_365delay_tick, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_364delay_tick};
static PyObject *__pyx_pw_8pysndlib_3clm_365delay_tick(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delay_tick (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3311, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3311, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("delay_tick", 1, 2, 2, 1); __PYX_ERR(0, 3311, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "delay_tick") < 0)) __PYX_ERR(0, 3311, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3311, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delay_tick", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3311, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.delay_tick", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3311, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_364delay_tick(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_364delay_tick(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delay_tick", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_delay_tick(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3311, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.delay_tick", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3311, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3311, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_365delay_tick, 0, __pyx_n_s_delay_tick, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__413)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay_tick, __pyx_t_40) < 0) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_delay_tick, 3311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) __PYX_ERR(0, 3311, __pyx_L1_error)
 3312:     """
 3313:     delay val according to the delay line's length. this merely 'ticks' the delay line forward.
 3314:     the argument 'insi' is returned.
 3315:     
 3316:     :param gen: delay gen
 3317:     :rtype: float
 3318:     """
+3319:     return cclm.mus_delay_tick(gen._ptr, insig)
  __pyx_r = mus_delay_tick(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3320: 
 3321: 
 3322: # ---------------- comb ---------------- #
+3323: cpdef mus_any make_comb(feedback: Optional[float]=1.0,
static PyObject *__pyx_pw_8pysndlib_3clm_367make_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_comb(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_comb *__pyx_optional_args) {
  PyObject *__pyx_v_feedback = ((PyObject *)__pyx_float_1_0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XDECREF(__pyx_v_max_size);
  __Pyx_XDECREF(__pyx_v_interp_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_367make_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_366make_comb, "\n    return a new comb filter (a delay line with a scaler on the feedback) of size elements. if the comb\n    length will be changing at run-time, max-size sets its maximum length.       \n    \n    :param feedback: scaler on feedback\n    :param size: delay length \\in samples\n    :param initial_contents: delay line's initial values\n    :param initial_element: delay line's initial element\n    :param max_size: maximum delay size \\in case the delay changes\n    :param type: interpolation type\n    :return: comb gen\n    :rtype: mus_any\n        \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_367make_comb = {"make_comb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_367make_comb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_366make_comb};
static PyObject *__pyx_pw_8pysndlib_3clm_367make_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_feedback = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  PyObject *__pyx_v_max_size = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_comb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_feedback,&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,&__pyx_n_s_max_size,&__pyx_n_s_interp_type,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_float_1_0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_366make_comb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_feedback, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element, PyObject *__pyx_v_max_size, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_comb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.feedback = __pyx_v_feedback;
  __pyx_t_2.size = __pyx_v_size;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_2.max_size = __pyx_v_max_size;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_comb(0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__414 = PyTuple_Pack(6, __pyx_n_s_feedback, __pyx_n_s_size, __pyx_n_s_initial_contents, __pyx_n_s_initial_element, __pyx_n_s_max_size, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__414);
  __Pyx_GIVEREF(__pyx_tuple__414);
/* … */
  __pyx_t_37 = PyTuple_New(6); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_float_1_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 1, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 2, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 3, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 4, Py_None);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_37, 5, __pyx_t_40);
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_feedback, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_initial_element, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_max_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3323, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_367make_comb, 0, __pyx_n_s_make_comb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__415)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_comb, __pyx_t_41) < 0) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_comb, 3323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) __PYX_ERR(0, 3323, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_comb {
  int __pyx_n;
  PyObject *feedback;
  PyObject *size;
  PyObject *initial_contents;
  PyObject *initial_element;
  PyObject *max_size;
  PyObject *interp_type;
};
+3324:                 size: Optional[int]=None,
  PyObject *__pyx_v_size = ((PyObject *)Py_None);
/* … */
    values[1] = ((PyObject *)Py_None);
+3325:                 initial_contents=None,
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
/* … */
    values[2] = ((PyObject *)Py_None);
+3326:                 initial_element: Optional[float]=None,
  PyObject *__pyx_v_initial_element = ((PyObject *)Py_None);
/* … */
    values[3] = ((PyObject *)Py_None);
+3327:                 max_size:Optional[int]=None,
  PyObject *__pyx_v_max_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_interp_type = __pyx_k__39;
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_comb", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_feedback = __pyx_optional_args->feedback;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_size = __pyx_optional_args->size;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_initial_element = __pyx_optional_args->initial_element;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_max_size = __pyx_optional_args->max_size;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_interp_type = __pyx_optional_args->interp_type;
              }
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
  __Pyx_INCREF(__pyx_v_max_size);
  __Pyx_INCREF(__pyx_v_interp_type);
/* … */
    values[4] = ((PyObject *)Py_None);
    values[5] = __pyx_k__39;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_size);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3323, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3323, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_comb") < 0)) __PYX_ERR(0, 3323, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_feedback = values[0];
    __pyx_v_size = values[1];
    __pyx_v_initial_contents = values[2];
    __pyx_v_initial_element = values[3];
    __pyx_v_max_size = values[4];
    __pyx_v_interp_type = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_comb", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 3323, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_366make_comb(__pyx_self, __pyx_v_feedback, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_initial_element, __pyx_v_max_size, __pyx_v_interp_type);
+3328:                 interp_type=Interp.NONE):
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_k__39 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
/* … */
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
 3329:     """
 3330:     return a new comb filter (a delay line with a scaler on the feedback) of size elements. if the comb
 3331:     length will be changing at run-time, max-size sets its maximum length.       
 3332:     
 3333:     :param feedback: scaler on feedback
 3334:     :param size: delay length \in samples
 3335:     :param initial_contents: delay line's initial values
 3336:     :param initial_element: delay line's initial element
 3337:     :param max_size: maximum delay size \in case the delay changes
 3338:     :param type: interpolation type
 3339:     :return: comb gen
 3340:     :rtype: mus_any
 3341:         
 3342:     """
 3343: 
+3344:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3345: 
+3346:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3346, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3347: 
+3348:     if not max_size:
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_max_size); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3348, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {
/* … */
  }
+3349:         max_size = size
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_DECREF_SET(__pyx_v_max_size, __pyx_v_size);
 3350: 
+3351:     if max_size != size and interp_type == Interp.NONE:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_max_size, __pyx_v_size, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3351, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_7 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_interp_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_7) {
/* … */
  }
+3352:         interp_type = Interp.BEZIER #think this is correct from clm2xen.c
    __pyx_t_2 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_BEZIER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_interp_type, __pyx_t_2);
    __pyx_t_2 = 0;
 3353: 
+3354:     if initial_contents is not None:
  __pyx_t_7 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L7;
  }
+3355:         if isinstance(initial_contents, list):
    __pyx_t_7 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_7) {
/* … */
    }
+3356:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3356, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
      __pyx_t_2 = 0;
+3357:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3358:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3358, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3359: 
+3360:     elif initial_element:
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_initial_element); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 3360, __pyx_L1_error)
  if (__pyx_t_7) {
/* … */
  }
  __pyx_L7:;
+3361:         initial_contents = np.zeros(max_size)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_max_size};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3361, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
    __pyx_t_2 = 0;
+3362:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_initial_contents};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3363:         initial_contents.fill(initial_element)
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_initial_element};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3364:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3364, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3365: 
+3366:     if initial_contents_view is not None:
  __pyx_t_7 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L9;
  }
+3367:         gen = mus_any.from_ptr(cclm.mus_make_comb(feedback, size, &initial_contents_view[0], max_size, interp_type))
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_feedback); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3367, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3367, __pyx_L1_error)
    __pyx_t_9 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      __PYX_ERR(0, 3367, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3367, __pyx_L1_error)
    __pyx_t_11 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3367, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_comb(__pyx_t_8, __pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_9 * __pyx_v_initial_contents_view.strides[0]) )))), __pyx_t_10, __pyx_t_11), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
 3368:     else:
+3369:         gen = mus_any.from_ptr(cclm.mus_make_comb(feedback, size, NULL, max_size, interp_type))
  /*else*/ {
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_feedback); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3369, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3369, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3369, __pyx_L1_error)
    __pyx_t_11 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3369, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_comb(__pyx_t_8, __pyx_t_10, NULL, __pyx_t_4, __pyx_t_11), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L9:;
+3370:     gen.cache_append(initial_contents)
  __pyx_t_2 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3371:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3372: 
+3373: cpdef cython.double comb(gen: mus_any, insig: float, pm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_369comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_comb(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_comb *__pyx_optional_args) {
  PyObject *__pyx_v_pm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("comb", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_pm = __pyx_optional_args->pm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_369comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_368comb, "\n    comb filter val, pm changes the delay length.\n    \n    :param gen: comb gen\n    :param insig: input value\n    :param pm: change \\in delay length size. can be + or -\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_369comb = {"comb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_369comb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_368comb};
static PyObject *__pyx_pw_8pysndlib_3clm_369comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_pm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("comb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_pm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("comb", 0, 2, 3, 1); __PYX_ERR(0, 3373, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "comb") < 0)) __PYX_ERR(0, 3373, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
    __pyx_v_pm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("comb", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3373, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3373, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_368comb(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_pm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_368comb(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_pm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("comb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.pm = __pyx_v_pm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_comb(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3373, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3373, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_pm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3373, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_369comb, 0, __pyx_n_s_comb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__416)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_comb, __pyx_t_40) < 0) __PYX_ERR(0, 3373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_comb, 3373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(0, 3373, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_comb {
  int __pyx_n;
  PyObject *pm;
};
 3374:     """
 3375:     comb filter val, pm changes the delay length.
 3376:     
 3377:     :param gen: comb gen
 3378:     :param insig: input value
 3379:     :param pm: change \in delay length size. can be + or -
 3380:     :rtype: float
 3381:     """
+3382:     if pm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3382, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3383:         return cclm.mus_comb(gen._ptr, insig, pm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3383, __pyx_L1_error)
    __pyx_r = mus_comb(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 3384:     else:
+3385:         return cclm.mus_comb_unmodulated(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_comb_unmodulated(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 3386: 
+3387: cpdef bint is_comb(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_371is_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_comb(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_comb", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_371is_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_370is_comb, "\n    returns True if gen is a comb.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_371is_comb = {"is_comb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_371is_comb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_370is_comb};
static PyObject *__pyx_pw_8pysndlib_3clm_371is_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_comb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3387, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_comb") < 0)) __PYX_ERR(0, 3387, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_comb", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3387, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3387, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_370is_comb(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_370is_comb(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_comb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_comb(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3387, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3387, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_371is_comb, 0, __pyx_n_s_is_comb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__417)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_comb, __pyx_t_41) < 0) __PYX_ERR(0, 3387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_comb, 3387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) __PYX_ERR(0, 3387, __pyx_L1_error)
 3388:     """
 3389:     returns True if gen is a comb.
 3390:     
 3391:     :param gen: gen
 3392:     :rtype: bool
 3393:     """
+3394:     return cclm.mus_is_comb(gen._ptr)
  __pyx_r = mus_is_comb(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3395: 
 3396: # ---------------- comb-bank ---------------- #
+3397: cpdef mus_any make_comb_bank(combs: list):
static PyObject *__pyx_pw_8pysndlib_3clm_373make_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_comb_bank(PyObject *__pyx_v_combs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_comb_array = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_comb_bank", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.make_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_comb_array);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_373make_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_372make_comb_bank, "\n    return a new comb-bank generator.\n    \n    :param combs: list of comb gens\n    :return: comb_bank gen\n    :rtype: mus_any\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_373make_comb_bank = {"make_comb_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_373make_comb_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_372make_comb_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_373make_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_combs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_comb_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_combs,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_combs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_comb_bank") < 0)) __PYX_ERR(0, 3397, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_combs = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_comb_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3397, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_combs), (&PyList_Type), 0, "combs", 1))) __PYX_ERR(0, 3397, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_372make_comb_bank(__pyx_self, __pyx_v_combs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_372make_comb_bank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_combs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_comb_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_comb_bank(__pyx_v_combs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__418 = PyTuple_Pack(1, __pyx_n_s_combs); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(0, 3397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__418);
  __Pyx_GIVEREF(__pyx_tuple__418);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_combs, __pyx_n_s_list) < 0) __PYX_ERR(0, 3397, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_373make_comb_bank, 0, __pyx_n_s_make_comb_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__419)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_comb_bank, __pyx_t_40) < 0) __PYX_ERR(0, 3397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_comb_bank, 3397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) __PYX_ERR(0, 3397, __pyx_L1_error)
 3398:     """
 3399:     return a new comb-bank generator.
 3400:     
 3401:     :param combs: list of comb gens
 3402:     :return: comb_bank gen
 3403:     :rtype: mus_any
 3404:     
 3405:     """
 3406: 
+3407:     p = list(map(is_comb, combs))
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_comb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_combs);
  __Pyx_GIVEREF(__pyx_v_combs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_combs);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_p = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
+3408:     if not all(p):
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 3408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (unlikely(__pyx_t_4)) {
/* … */
  }
+3409:         raise TypeError(f'filter list contains at least one element that is not a formant.')
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3409, __pyx_L1_error)
 3410: 
+3411:     comb_array = mus_any_array.from_pylist(combs)
  __pyx_t_2 = ((PyObject *)__pyx_f_8pysndlib_3clm_13mus_any_array_from_pylist(__pyx_v_combs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_comb_array = ((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_t_2);
  __pyx_t_2 = 0;
 3412: 
+3413:     gen = mus_any.from_ptr(cclm.mus_make_comb_bank(len(combs), comb_array.data))
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_combs); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3413, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_comb_bank(__pyx_t_5, __pyx_v_comb_array->data), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
+3414:     gen.cache_extend([comb_array, combs])
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_comb_array);
  __Pyx_GIVEREF((PyObject *)__pyx_v_comb_array);
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_comb_array));
  __Pyx_INCREF(__pyx_v_combs);
  __Pyx_GIVEREF(__pyx_v_combs);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_combs);
  __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3415:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3416: 
+3417: cpdef cython.double comb_bank(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_375comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_comb_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("comb_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_375comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_374comb_bank, "\n    sum an array of comb filters.\n    \n    :param gen: comb_bank gen\n    :param inputs: can be a list/array of inputs or a single input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_375comb_bank = {"comb_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_375comb_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_374comb_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_375comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("comb_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3417, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3417, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("comb_bank", 1, 2, 2, 1); __PYX_ERR(0, 3417, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "comb_bank") < 0)) __PYX_ERR(0, 3417, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3417, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("comb_bank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3417, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3417, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_374comb_bank(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_374comb_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("comb_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_comb_bank(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3417, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3417, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3417, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_375comb_bank, 0, __pyx_n_s_comb_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__420)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_comb_bank, __pyx_t_41) < 0) __PYX_ERR(0, 3417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__420 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_comb_bank, 3417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__420)) __PYX_ERR(0, 3417, __pyx_L1_error)
 3418:     """
 3419:     sum an array of comb filters.
 3420:     
 3421:     :param gen: comb_bank gen
 3422:     :param inputs: can be a list/array of inputs or a single input
 3423:     :rtype: float
 3424:     """
+3425:     return cclm.mus_comb_bank(gen._ptr, insig)
  __pyx_r = mus_comb_bank(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3426: 
+3427: cpdef bint is_comb_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_377is_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_comb_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_comb_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_377is_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_376is_comb_bank, "\n    returns True if gen is a comb_bank\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_377is_comb_bank = {"is_comb_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_377is_comb_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_376is_comb_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_377is_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_comb_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_comb_bank") < 0)) __PYX_ERR(0, 3427, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_comb_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3427, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3427, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_376is_comb_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_376is_comb_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_comb_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_comb_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3427, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3427, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_377is_comb_bank, 0, __pyx_n_s_is_comb_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__421)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_comb_bank, __pyx_t_40) < 0) __PYX_ERR(0, 3427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_comb_bank, 3427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) __PYX_ERR(0, 3427, __pyx_L1_error)
 3428:     """
 3429:     returns True if gen is a comb_bank
 3430:     
 3431:     :param gen: gen
 3432:     :rtype: bool
 3433:     """
+3434:     return cclm.mus_is_comb_bank(gen._ptr)
  __pyx_r = mus_is_comb_bank(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3435: 
 3436: 
 3437: # ---------------- filtered-comb ---------------- #
+3438: cpdef mus_any make_filtered_comb(feedback:  float,
static PyObject *__pyx_pw_8pysndlib_3clm_379make_filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_filtered_comb(double __pyx_v_feedback, PyObject *__pyx_v_size, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_filter, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_filtered_comb *__pyx_optional_args) {
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XDECREF(__pyx_v_max_size);
  __Pyx_XDECREF(__pyx_v_interp_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_379make_filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_378make_filtered_comb, "\n    return a new filtered comb filter (a delay line with a scaler and a filter on the feedback) of size\n    elements. if the comb length will be changing at run-time, max-size sets its maximum length.     \n    \n    :param feedback: scaler on feedback\n    :param size: delay length \\in samples\n    :param filter: filter to apply \n    :param initial_contents: delay line's initial values\n    :param initial_element: delay line's initial element\n    :param max_size: maximum delay size \\in case the delay changes\n    :param type: interpolation type\n    :return: filtered_comb gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_379make_filtered_comb = {"make_filtered_comb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_379make_filtered_comb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_378make_filtered_comb};
static PyObject *__pyx_pw_8pysndlib_3clm_379make_filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_feedback;
  PyObject *__pyx_v_size = 0;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_filter = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  PyObject *__pyx_v_max_size = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filtered_comb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_feedback,&__pyx_n_s_size,&__pyx_n_s_filter,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,&__pyx_n_s_max_size,&__pyx_n_s_interp_type,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_378make_filtered_comb(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_feedback, PyObject *__pyx_v_size, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_filter, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element, PyObject *__pyx_v_max_size, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filtered_comb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_2.max_size = __pyx_v_max_size;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_filtered_comb(__pyx_v_feedback, __pyx_v_size, __pyx_v_filter, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__422 = PyTuple_Pack(7, __pyx_n_s_feedback, __pyx_n_s_size, __pyx_n_s_filter, __pyx_n_s_initial_contents, __pyx_n_s_initial_element, __pyx_n_s_max_size, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__422);
  __Pyx_GIVEREF(__pyx_tuple__422);
/* … */
  __pyx_t_41 = PyTuple_New(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 0, Py_None);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_41, 1, __pyx_float_0_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 2, Py_None);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_41, 3, __pyx_t_40);
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_feedback, __pyx_n_s_float) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_filter, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_initial_element, __pyx_kp_s_Optional_cython_double) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_max_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_379make_filtered_comb, 0, __pyx_n_s_make_filtered_comb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__423)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_filtered_comb, __pyx_t_37) < 0) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_filtered_comb, 3438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) __PYX_ERR(0, 3438, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_filtered_comb {
  int __pyx_n;
  PyObject *initial_contents;
  PyObject *initial_element;
  PyObject *max_size;
  PyObject *interp_type;
};
 3439:                 size: int,
 3440:                 filter: mus_any,
+3441:                 initial_contents=None,
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
  PyObject *__pyx_v_initial_element = ((PyObject *)__pyx_float_0_0);
/* … */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)__pyx_float_0_0);
 3442:                 initial_element: Optional[ cython.double]=0.0,
+3443:                 max_size:Optional[int]=None,
  PyObject *__pyx_v_max_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_interp_type = __pyx_k__40;
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filtered_comb", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_element = __pyx_optional_args->initial_element;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_size = __pyx_optional_args->max_size;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_interp_type = __pyx_optional_args->interp_type;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
  __Pyx_INCREF(__pyx_v_max_size);
  __Pyx_INCREF(__pyx_v_interp_type);
/* … */
    values[5] = ((PyObject *)Py_None);
    values[6] = __pyx_k__40;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_filtered_comb", 0, 3, 7, 1); __PYX_ERR(0, 3438, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filter)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_filtered_comb", 0, 3, 7, 2); __PYX_ERR(0, 3438, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_size);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_filtered_comb") < 0)) __PYX_ERR(0, 3438, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_feedback = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_feedback == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
    __pyx_v_size = ((PyObject*)values[1]);
    __pyx_v_filter = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[2]);
    __pyx_v_initial_contents = values[3];
    __pyx_v_initial_element = values[4];
    __pyx_v_max_size = values[5];
    __pyx_v_interp_type = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_filtered_comb", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 3438, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3439, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "filter", 0))) __PYX_ERR(0, 3440, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_378make_filtered_comb(__pyx_self, __pyx_v_feedback, __pyx_v_size, __pyx_v_filter, __pyx_v_initial_contents, __pyx_v_initial_element, __pyx_v_max_size, __pyx_v_interp_type);
+3444:                 interp_type=Interp.NONE):
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_k__40 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
/* … */
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
 3445:                 
 3446:     """
 3447:     return a new filtered comb filter (a delay line with a scaler and a filter on the feedback) of size
 3448:     elements. if the comb length will be changing at run-time, max-size sets its maximum length.     
 3449:     
 3450:     :param feedback: scaler on feedback
 3451:     :param size: delay length \in samples
 3452:     :param filter: filter to apply 
 3453:     :param initial_contents: delay line's initial values
 3454:     :param initial_element: delay line's initial element
 3455:     :param max_size: maximum delay size \in case the delay changes
 3456:     :param type: interpolation type
 3457:     :return: filtered_comb gen
 3458:     :rtype: mus_any
 3459:     """
+3460:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3461: 
+3462:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3462, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3463: 
+3464:     if not max_size:
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_max_size); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3464, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {
/* … */
  }
+3465:         max_size = size
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_DECREF_SET(__pyx_v_max_size, __pyx_v_size);
 3466: 
+3467:     if max_size != size and interp_type == Interp.NONE:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_max_size, __pyx_v_size, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3467, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_7 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_interp_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_7) {
/* … */
  }
+3468:         interp_type = Interp.BEZIER #think this is correct from clm2xen.c
    __pyx_t_2 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_BEZIER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_interp_type, __pyx_t_2);
    __pyx_t_2 = 0;
 3469: 
+3470:     if initial_contents is not None:
  __pyx_t_7 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L7;
  }
+3471:         if isinstance(initial_contents, list):
    __pyx_t_7 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_7) {
/* … */
    }
+3472:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
      __pyx_t_2 = 0;
+3473:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3473, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3474: 
+3475:     elif initial_element:
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_initial_element); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 3475, __pyx_L1_error)
  if (__pyx_t_7) {
/* … */
  }
  __pyx_L7:;
+3476:         initial_contents = np.zeros(max_size)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_max_size};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
    __pyx_t_2 = 0;
+3477:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_initial_contents};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3478:         initial_contents.fill(initial_element)
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_initial_element};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3478, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3479:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3479, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3480: 
+3481:     if initial_contents_view is not None:
  __pyx_t_7 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L9;
  }
+3482:         gen = mus_any.from_ptr(cclm.mus_make_filtered_comb(feedback, int(size), &initial_contents_view[0], int(max_size), interp_type, filter._ptr))
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = -1;
    if (__pyx_t_8 < 0) {
      __pyx_t_8 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_8 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      __PYX_ERR(0, 3482, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_max_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3482, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_filtered_comb(__pyx_v_feedback, __pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_8 * __pyx_v_initial_contents_view.strides[0]) )))), __pyx_t_9, __pyx_t_10, __pyx_v_filter->_ptr), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
 3483:     else:
+3484:         gen = mus_any.from_ptr(cclm.mus_make_filtered_comb(feedback, int(size), NULL, int(max_size), interp_type, filter._ptr))
  /*else*/ {
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_max_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_filtered_comb(__pyx_v_feedback, __pyx_t_9, NULL, __pyx_t_4, __pyx_t_10, __pyx_v_filter->_ptr), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L9:;
+3485:     gen.cache_append(initial_contents)
  __pyx_t_2 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3486:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3487: 
+3488: cpdef cython.double filtered_comb(gen: mus_any, insig: float, pm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_381filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_filtered_comb(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_filtered_comb *__pyx_optional_args) {
  PyObject *__pyx_v_pm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filtered_comb", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_pm = __pyx_optional_args->pm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_381filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_380filtered_comb, "\n    filtered comb filter val, pm changes the delay length.\n    \n    :param gen: filtered_comb gen\n    :param insig: input value\n    :param pm: change \\in delay length size. can be + or -\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_381filtered_comb = {"filtered_comb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_381filtered_comb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_380filtered_comb};
static PyObject *__pyx_pw_8pysndlib_3clm_381filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_pm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filtered_comb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_pm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("filtered_comb", 0, 2, 3, 1); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filtered_comb") < 0)) __PYX_ERR(0, 3488, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_pm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filtered_comb", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3488, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_380filtered_comb(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_pm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_380filtered_comb(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_pm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filtered_comb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.pm = __pyx_v_pm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_filtered_comb(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3488, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3488, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_pm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3488, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_381filtered_comb, 0, __pyx_n_s_filtered_comb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__424)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_filtered_comb, __pyx_t_40) < 0) __PYX_ERR(0, 3488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__424 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_filtered_comb, 3488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__424)) __PYX_ERR(0, 3488, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_filtered_comb {
  int __pyx_n;
  PyObject *pm;
};
 3489:     """
 3490:     filtered comb filter val, pm changes the delay length.
 3491:     
 3492:     :param gen: filtered_comb gen
 3493:     :param insig: input value
 3494:     :param pm: change \in delay length size. can be + or -
 3495:     :rtype: float
 3496:     """
+3497:     if pm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3497, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3498:         return cclm.mus_filtered_comb(gen._ptr, insig, pm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L1_error)
    __pyx_r = mus_filtered_comb(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 3499:     else:
+3500:         return cclm.mus_filtered_comb_unmodulated(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_filtered_comb_unmodulated(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 3501: 
+3502: cpdef bint is_filtered_comb(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_383is_filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_filtered_comb(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filtered_comb", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_383is_filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_382is_filtered_comb, "\n    returns True if gen is a filtered_comb.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_383is_filtered_comb = {"is_filtered_comb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_383is_filtered_comb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_382is_filtered_comb};
static PyObject *__pyx_pw_8pysndlib_3clm_383is_filtered_comb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filtered_comb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3502, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_filtered_comb") < 0)) __PYX_ERR(0, 3502, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_filtered_comb", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3502, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3502, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_382is_filtered_comb(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_382is_filtered_comb(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filtered_comb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_filtered_comb(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3502, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_filtered_comb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3502, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_383is_filtered_comb, 0, __pyx_n_s_is_filtered_comb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__425)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_filtered_comb, __pyx_t_37) < 0) __PYX_ERR(0, 3502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_filtered_comb, 3502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) __PYX_ERR(0, 3502, __pyx_L1_error)
 3503:     """
 3504:     returns True if gen is a filtered_comb.
 3505:     
 3506:     :param gen: gen
 3507:     :rtype: bool
 3508:     """
+3509:     return cclm.mus_is_filtered_comb(gen._ptr)
  __pyx_r = mus_is_filtered_comb(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3510: 
 3511: # ---------------- filtered-comb-bank ---------------- #      
+3512: cpdef mus_any make_filtered_comb_bank(fcombs: list):
static PyObject *__pyx_pw_8pysndlib_3clm_385make_filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_filtered_comb_bank(PyObject *__pyx_v_fcombs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_fcomb_array = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filtered_comb_bank", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.make_filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_fcomb_array);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_385make_filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_384make_filtered_comb_bank, "\n    return a new filtered_comb-bank generator.\n    \n    :param fcombs: list of filtered_comb gens\n    :return: filtered_comb_bank gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_385make_filtered_comb_bank = {"make_filtered_comb_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_385make_filtered_comb_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_384make_filtered_comb_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_385make_filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fcombs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filtered_comb_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fcombs,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fcombs)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3512, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_filtered_comb_bank") < 0)) __PYX_ERR(0, 3512, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_fcombs = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_filtered_comb_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3512, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fcombs), (&PyList_Type), 0, "fcombs", 1))) __PYX_ERR(0, 3512, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_384make_filtered_comb_bank(__pyx_self, __pyx_v_fcombs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_384make_filtered_comb_bank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fcombs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_filtered_comb_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_filtered_comb_bank(__pyx_v_fcombs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__426 = PyTuple_Pack(1, __pyx_n_s_fcombs); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__426);
  __Pyx_GIVEREF(__pyx_tuple__426);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fcombs, __pyx_n_s_list) < 0) __PYX_ERR(0, 3512, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_385make_filtered_comb_bank, 0, __pyx_n_s_make_filtered_comb_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__427)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_filtered_comb_bank, __pyx_t_40) < 0) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_filtered_comb_bank, 3512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) __PYX_ERR(0, 3512, __pyx_L1_error)
 3513:     """
 3514:     return a new filtered_comb-bank generator.
 3515:     
 3516:     :param fcombs: list of filtered_comb gens
 3517:     :return: filtered_comb_bank gen
 3518:     :rtype: mus_any
 3519:     """
+3520:     p = list(map(is_formant, fcombs))
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_formant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_fcombs);
  __Pyx_GIVEREF(__pyx_v_fcombs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fcombs);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_p = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
+3521:     if not all(p):
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 3521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (unlikely(__pyx_t_4)) {
/* … */
  }
+3522:         raise TypeError(f'filter list contains at least one element that is not a filtered_comb.')
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3522, __pyx_L1_error)
/* … */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_filter_list_contains_at_least_on_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 3522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);
 3523: 
+3524:     fcomb_array = mus_any_array.from_pylist(fcombs)
  __pyx_t_2 = ((PyObject *)__pyx_f_8pysndlib_3clm_13mus_any_array_from_pylist(__pyx_v_fcombs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_fcomb_array = ((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_t_2);
  __pyx_t_2 = 0;
 3525: 
+3526:     gen =  mus_any.from_ptr(cclm.mus_make_filtered_comb_bank(len(fcombs), fcomb_array.data))
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_fcombs); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3526, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_filtered_comb_bank(__pyx_t_5, __pyx_v_fcomb_array->data), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
+3527:     gen.cache_extend([fcomb_array, fcombs])
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_fcomb_array);
  __Pyx_GIVEREF((PyObject *)__pyx_v_fcomb_array);
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_fcomb_array));
  __Pyx_INCREF(__pyx_v_fcombs);
  __Pyx_GIVEREF(__pyx_v_fcombs);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_fcombs);
  __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3528:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3529: 
+3530: cpdef cython.double filtered_comb_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_387filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_filtered_comb_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filtered_comb_bank", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_387filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_386filtered_comb_bank, "\n    sum an array of filtered_comb filters.\n    \n    :param gen: filtered_comb gen\n    :param inputs: can be a list/array of inputs or a single input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_387filtered_comb_bank = {"filtered_comb_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_387filtered_comb_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_386filtered_comb_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_387filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filtered_comb_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3530, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "filtered_comb_bank") < 0)) __PYX_ERR(0, 3530, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filtered_comb_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3530, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3530, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_386filtered_comb_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_386filtered_comb_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filtered_comb_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_filtered_comb_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3530, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3530, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_387filtered_comb_bank, 0, __pyx_n_s_filtered_comb_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__428)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_filtered_comb_bank, __pyx_t_37) < 0) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__428 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_filtered_comb_bank, 3530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__428)) __PYX_ERR(0, 3530, __pyx_L1_error)
 3531:     """
 3532:     sum an array of filtered_comb filters.
 3533:     
 3534:     :param gen: filtered_comb gen
 3535:     :param inputs: can be a list/array of inputs or a single input
 3536:     :rtype: float
 3537:     """
+3538:     return cclm.mus_filtered_comb_bank(gen._ptr, input)
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_builtin_input); if (unlikely((__pyx_t_1 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3538, __pyx_L1_error)
  __pyx_r = mus_filtered_comb_bank(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 3539: 
+3540: cpdef bint is_filtered_comb_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_389is_filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_filtered_comb_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filtered_comb_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_389is_filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_388is_filtered_comb_bank, "\n    returns True if gen is a filtered_comb_bank.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_389is_filtered_comb_bank = {"is_filtered_comb_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_389is_filtered_comb_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_388is_filtered_comb_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_389is_filtered_comb_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filtered_comb_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3540, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_filtered_comb_bank") < 0)) __PYX_ERR(0, 3540, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_filtered_comb_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3540, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3540, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_388is_filtered_comb_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_388is_filtered_comb_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_filtered_comb_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_filtered_comb_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3540, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_filtered_comb_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_389is_filtered_comb_bank, 0, __pyx_n_s_is_filtered_comb_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__429)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_filtered_comb_bank, __pyx_t_40) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_filtered_comb_bank, 3540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) __PYX_ERR(0, 3540, __pyx_L1_error)
 3541:     """
 3542:     returns True if gen is a filtered_comb_bank.
 3543:     
 3544:     :param gen: gen
 3545:     :rtype: bool
 3546:     """
+3547:     return cclm.mus_is_filtered_comb_bank(gen._ptr)
  __pyx_r = mus_is_filtered_comb_bank(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3548: 
 3549: # ---------------- notch ---------------- #
+3550: cpdef mus_any make_notch(feedforward: Optional[float]=1.0,
static PyObject *__pyx_pw_8pysndlib_3clm_391make_notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_notch(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_notch *__pyx_optional_args) {
  PyObject *__pyx_v_feedforward = ((PyObject *)__pyx_float_1_0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysndlib.clm.make_notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XDECREF(__pyx_v_max_size);
  __Pyx_XDECREF(__pyx_v_interp_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_391make_notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_390make_notch, "\n    return a new notch filter (a delay line with a scaler on the feedforward) of size elements.\n    if the notch length will be changing at run-time, max-size sets its maximum length.\n    \n    :param feedforward: scaler on input\n    :param size: delay length \\in samples\n    :param initial_contents: delay line's initial values\n    :param initial_element: delay line's initial element\n    :param max_size: maximum delay size \\in case the delay changes\n    :param type: interpolation type\n    :return: comb gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_391make_notch = {"make_notch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_391make_notch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_390make_notch};
static PyObject *__pyx_pw_8pysndlib_3clm_391make_notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_feedforward = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  PyObject *__pyx_v_max_size = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_notch (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_feedforward,&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,&__pyx_n_s_max_size,&__pyx_n_s_interp_type,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_float_1_0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_390make_notch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_feedforward, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element, PyObject *__pyx_v_max_size, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_notch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.feedforward = __pyx_v_feedforward;
  __pyx_t_2.size = __pyx_v_size;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_2.max_size = __pyx_v_max_size;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_notch(0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__430 = PyTuple_Pack(6, __pyx_n_s_feedforward, __pyx_n_s_size, __pyx_n_s_initial_contents, __pyx_n_s_initial_element, __pyx_n_s_max_size, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__430);
  __Pyx_GIVEREF(__pyx_tuple__430);
/* … */
  __pyx_t_37 = PyTuple_New(6); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_float_1_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 1, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 2, Py_None);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_37, 3, __pyx_float_0_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 4, Py_None);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_37, 5, __pyx_t_40);
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_feedforward, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_initial_element, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_max_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3550, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_391make_notch, 0, __pyx_n_s_make_notch, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__431)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_notch, __pyx_t_41) < 0) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_notch, 3550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) __PYX_ERR(0, 3550, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_notch {
  int __pyx_n;
  PyObject *feedforward;
  PyObject *size;
  PyObject *initial_contents;
  PyObject *initial_element;
  PyObject *max_size;
  PyObject *interp_type;
};
+3551:                 size: Optional[int]=None,
  PyObject *__pyx_v_size = ((PyObject *)Py_None);
/* … */
    values[1] = ((PyObject *)Py_None);
+3552:                 initial_contents=None,
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
  PyObject *__pyx_v_initial_element = ((PyObject *)__pyx_float_0_0);
/* … */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_float_0_0);
 3553:                 initial_element: Optional[float]=0.0,
+3554:                 max_size:Optional[int]=None,
  PyObject *__pyx_v_max_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_interp_type = __pyx_k__42;
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_notch", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_feedforward = __pyx_optional_args->feedforward;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_size = __pyx_optional_args->size;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_initial_element = __pyx_optional_args->initial_element;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_max_size = __pyx_optional_args->max_size;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_interp_type = __pyx_optional_args->interp_type;
              }
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
  __Pyx_INCREF(__pyx_v_max_size);
  __Pyx_INCREF(__pyx_v_interp_type);
/* … */
    values[4] = ((PyObject *)Py_None);
    values[5] = __pyx_k__42;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedforward);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_size);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_notch") < 0)) __PYX_ERR(0, 3550, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_feedforward = values[0];
    __pyx_v_size = values[1];
    __pyx_v_initial_contents = values[2];
    __pyx_v_initial_element = values[3];
    __pyx_v_max_size = values[4];
    __pyx_v_interp_type = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_notch", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 3550, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_390make_notch(__pyx_self, __pyx_v_feedforward, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_initial_element, __pyx_v_max_size, __pyx_v_interp_type);
+3555:                 interp_type=Interp.NONE):
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_k__42 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
/* … */
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
 3556: 
 3557:     """
 3558:     return a new notch filter (a delay line with a scaler on the feedforward) of size elements.
 3559:     if the notch length will be changing at run-time, max-size sets its maximum length.
 3560:     
 3561:     :param feedforward: scaler on input
 3562:     :param size: delay length \in samples
 3563:     :param initial_contents: delay line's initial values
 3564:     :param initial_element: delay line's initial element
 3565:     :param max_size: maximum delay size \in case the delay changes
 3566:     :param type: interpolation type
 3567:     :return: comb gen
 3568:     :rtype: mus_any
 3569:     """
 3570: 
+3571:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3572: 
+3573:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3573, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3574: 
+3575:     if not max_size:
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_max_size); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3575, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {
/* … */
  }
+3576:         max_size = size
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_DECREF_SET(__pyx_v_max_size, __pyx_v_size);
 3577: 
+3578:     if max_size != size and interp_type == Interp.NONE:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_max_size, __pyx_v_size, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3578, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_7 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_interp_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_7) {
/* … */
  }
+3579:         interp_type = Interp.BEZIER #think this is correct from clm2xen.c
    __pyx_t_2 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_BEZIER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_interp_type, __pyx_t_2);
    __pyx_t_2 = 0;
 3580: 
 3581: 
+3582:     if initial_contents is not None:
  __pyx_t_7 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L7;
  }
+3583:         if isinstance(initial_contents, list):
    __pyx_t_7 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_7) {
/* … */
    }
+3584:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
      __pyx_t_2 = 0;
+3585:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3586:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3586, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3587: 
+3588:     elif initial_element:
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_initial_element); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 3588, __pyx_L1_error)
  if (__pyx_t_7) {
/* … */
  }
  __pyx_L7:;
+3589:         initial_contents = np.zeros(max_size, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_max_size);
    __Pyx_GIVEREF(__pyx_v_max_size);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_max_size);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_9);
    __pyx_t_9 = 0;
+3590:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3591:         initial_contents.fill(initial_element)
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_element};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3592:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3592, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3593: 
+3594:     if initial_contents_view is not None:
  __pyx_t_7 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L9;
  }
+3595:         gen = mus_any.from_ptr(cclm.mus_make_notch(feedforward, size, &initial_contents_view[0], max_size, interp_type))
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_feedforward); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L1_error)
    __pyx_t_11 = 0;
    __pyx_t_12 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_12 = 0;
    if (unlikely(__pyx_t_12 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_12);
      __PYX_ERR(0, 3595, __pyx_L1_error)
    }
    __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L1_error)
    __pyx_t_13 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3595, __pyx_L1_error)
    __pyx_t_9 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_notch(__pyx_t_10, __pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_11 * __pyx_v_initial_contents_view.strides[0]) )))), __pyx_t_12, __pyx_t_13), NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_9);
    __pyx_t_9 = 0;
 3596:     else:
+3597:         gen = mus_any.from_ptr(cclm.mus_make_notch(feedforward, size, NULL, max_size, interp_type))
  /*else*/ {
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_feedforward); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)
    __pyx_t_13 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L1_error)
    __pyx_t_9 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_notch(__pyx_t_10, __pyx_t_12, NULL, __pyx_t_4, __pyx_t_13), NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_9);
    __pyx_t_9 = 0;
  }
  __pyx_L9:;
+3598:     gen.cache_append(initial_contents)
  __pyx_t_9 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3599:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3600: 
+3601: cpdef cython.double notch(gen: mus_any, insig: float, pm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_393notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_notch(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_notch *__pyx_optional_args) {
  PyObject *__pyx_v_pm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("notch", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_pm = __pyx_optional_args->pm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_393notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_392notch, "\n    notch filter val, pm changes the delay length.\n        \n    :param gen: notch gen\n    :param insig: input value\n    :param pm: change \\in delay length size. can be + or -\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_393notch = {"notch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_393notch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_392notch};
static PyObject *__pyx_pw_8pysndlib_3clm_393notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_pm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("notch (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_pm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("notch", 0, 2, 3, 1); __PYX_ERR(0, 3601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "notch") < 0)) __PYX_ERR(0, 3601, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_pm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("notch", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3601, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3601, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_392notch(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_pm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_392notch(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_pm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("notch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.pm = __pyx_v_pm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_notch(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3601, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3601, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_pm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3601, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_393notch, 0, __pyx_n_s_notch, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__432)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_notch, __pyx_t_40) < 0) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__432 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_notch, 3601, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__432)) __PYX_ERR(0, 3601, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_notch {
  int __pyx_n;
  PyObject *pm;
};
 3602:     """
 3603:     notch filter val, pm changes the delay length.
 3604:         
 3605:     :param gen: notch gen
 3606:     :param insig: input value
 3607:     :param pm: change \in delay length size. can be + or -
 3608:     :rtype: float
 3609:     """
+3610:     if pm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3610, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3611:         return cclm.mus_notch(gen._ptr, insig, pm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3611, __pyx_L1_error)
    __pyx_r = mus_notch(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 3612:     else:
+3613:         return cclm.mus_notch_unmodulated(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_notch_unmodulated(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 3614: 
+3615: cpdef bint is_notch(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_395is_notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_notch(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_notch", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_395is_notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_394is_notch, "\n    returns True if gen is a notch.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_395is_notch = {"is_notch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_395is_notch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_394is_notch};
static PyObject *__pyx_pw_8pysndlib_3clm_395is_notch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_notch (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3615, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_notch") < 0)) __PYX_ERR(0, 3615, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_notch", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3615, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3615, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_394is_notch(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_394is_notch(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_notch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_notch(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3615, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_notch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3615, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_395is_notch, 0, __pyx_n_s_is_notch, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__433)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_notch, __pyx_t_41) < 0) __PYX_ERR(0, 3615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_notch, 3615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(0, 3615, __pyx_L1_error)
 3616:     """
 3617:     returns True if gen is a notch.
 3618:     
 3619:     :param gen: gen
 3620:     :rtype: bool
 3621:     """
+3622:     return cclm.mus_is_notch(gen._ptr)
  __pyx_r = mus_is_notch(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3623: 
 3624: 
 3625: # ---------------- all-pass ---------------- #
+3626: cpdef mus_any make_all_pass(feedback: float, feedforward: float, size: int, initial_contents: Optional[np.ndarray] = None, initial_element: Optional[float] = 0.0,  max_size:Optional[int] = None, interp_type: Optional[Interp] = Interp.NONE):
static PyObject *__pyx_pw_8pysndlib_3clm_397make_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_all_pass(double __pyx_v_feedback, double __pyx_v_feedforward, PyObject *__pyx_v_size, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_all_pass *__pyx_optional_args) {
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
  PyObject *__pyx_v_initial_element = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_max_size = ((PyObject *)Py_None);
  PyObject *__pyx_v_interp_type = __pyx_k__43;
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_all_pass", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_element = __pyx_optional_args->initial_element;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_size = __pyx_optional_args->max_size;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_interp_type = __pyx_optional_args->interp_type;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
  __Pyx_INCREF(__pyx_v_max_size);
  __Pyx_INCREF(__pyx_v_interp_type);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysndlib.clm.make_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XDECREF(__pyx_v_max_size);
  __Pyx_XDECREF(__pyx_v_interp_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_397make_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_396make_all_pass, "\n    return a new allpass filter (a delay line with a scalers on both the feedback and the feedforward).\n    if length will be changing at run-time, max-size sets its maximum length.\n    \n    :param feedback: scaler on feedback\n    :param feedforward: scaler on input\n    :param size: length \\in samples of the delay line\n    :param initial_contents: delay line's initial values\n    :param initial_element: delay line's initial element\n    :param max_size: maximum delay size \\in case the delay changes\n    :param interp_type: interpolation type\n    :return: a new allpass filter\n    :rtype: mus_any\n     \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_397make_all_pass = {"make_all_pass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_397make_all_pass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_396make_all_pass};
static PyObject *__pyx_pw_8pysndlib_3clm_397make_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_feedback;
  double __pyx_v_feedforward;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  PyObject *__pyx_v_max_size = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_all_pass (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_feedback,&__pyx_n_s_feedforward,&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,&__pyx_n_s_max_size,&__pyx_n_s_interp_type,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)__pyx_float_0_0);
    values[5] = ((PyObject *)Py_None);
    values[6] = __pyx_k__43;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedback)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_feedforward)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_all_pass", 0, 3, 7, 1); __PYX_ERR(0, 3626, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_all_pass", 0, 3, 7, 2); __PYX_ERR(0, 3626, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_size);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_all_pass") < 0)) __PYX_ERR(0, 3626, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_feedback = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_feedback == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
    __pyx_v_feedforward = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_feedforward == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L3_error)
    __pyx_v_size = ((PyObject*)values[2]);
    __pyx_v_initial_contents = values[3];
    __pyx_v_initial_element = values[4];
    __pyx_v_max_size = values[5];
    __pyx_v_interp_type = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_all_pass", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 3626, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3626, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_396make_all_pass(__pyx_self, __pyx_v_feedback, __pyx_v_feedforward, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_initial_element, __pyx_v_max_size, __pyx_v_interp_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_396make_all_pass(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_feedback, double __pyx_v_feedforward, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element, PyObject *__pyx_v_max_size, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_all_pass", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_2.max_size = __pyx_v_max_size;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_all_pass(__pyx_v_feedback, __pyx_v_feedforward, __pyx_v_size, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_k__43 = __pyx_t_41;
  __Pyx_GIVEREF(__pyx_t_41);
  __pyx_t_41 = 0;
/* … */
  __pyx_tuple__434 = PyTuple_Pack(7, __pyx_n_s_feedback, __pyx_n_s_feedforward, __pyx_n_s_size, __pyx_n_s_initial_contents, __pyx_n_s_initial_element, __pyx_n_s_max_size, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__434);
  __Pyx_GIVEREF(__pyx_tuple__434);
  __pyx_t_41 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_40 = PyTuple_New(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_40, 0, Py_None);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_40, 1, __pyx_float_0_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_40, 2, Py_None);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_40, 3, __pyx_t_41);
  __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_feedback, __pyx_n_s_float) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_feedforward, __pyx_n_s_float) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_initial_contents, __pyx_kp_s_Optional_np_ndarray) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_initial_element, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_max_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_interp_type, __pyx_kp_s_Optional_Interp) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_397make_all_pass, 0, __pyx_n_s_make_all_pass, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__435)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_all_pass, __pyx_t_37) < 0) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_all_pass, 3626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(0, 3626, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_all_pass {
  int __pyx_n;
  PyObject *initial_contents;
  PyObject *initial_element;
  PyObject *max_size;
  PyObject *interp_type;
};
 3627: 
 3628:     """
 3629:     return a new allpass filter (a delay line with a scalers on both the feedback and the feedforward).
 3630:     if length will be changing at run-time, max-size sets its maximum length.
 3631:     
 3632:     :param feedback: scaler on feedback
 3633:     :param feedforward: scaler on input
 3634:     :param size: length \in samples of the delay line
 3635:     :param initial_contents: delay line's initial values
 3636:     :param initial_element: delay line's initial element
 3637:     :param max_size: maximum delay size \in case the delay changes
 3638:     :param interp_type: interpolation type
 3639:     :return: a new allpass filter
 3640:     :rtype: mus_any
 3641:      
 3642:     """
 3643: 
+3644:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3645: 
+3646:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3646, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3647: 
+3648:     if not max_size:
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_max_size); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3648, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {
/* … */
  }
+3649:         max_size = size
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_DECREF_SET(__pyx_v_max_size, __pyx_v_size);
 3650: 
+3651:     if max_size != size and interp_type == Interp.NONE:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_max_size, __pyx_v_size, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_7 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_interp_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_7) {
/* … */
  }
+3652:         interp_type = Interp.HERMITE #think this is correct from clm2xen.c
    __pyx_t_2 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_HERMITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_interp_type, __pyx_t_2);
    __pyx_t_2 = 0;
 3653: 
 3654: 
+3655:     if initial_contents is not None:
  __pyx_t_7 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L7;
  }
+3656:         if isinstance(initial_contents, list):
    __pyx_t_7 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_7) {
/* … */
    }
+3657:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3657, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_2);
      __pyx_t_2 = 0;
+3658:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3658, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+3659:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3659, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3660: 
+3661:     elif initial_element:
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_initial_element); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 3661, __pyx_L1_error)
  if (__pyx_t_7) {
/* … */
  }
  __pyx_L7:;
+3662:         initial_contents = np.zeros(max_size, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_max_size);
    __Pyx_GIVEREF(__pyx_v_max_size);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_max_size);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_double); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_9);
    __pyx_t_9 = 0;
+3663:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3664:         initial_contents.fill(initial_element)
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_element};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3665:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3665, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3666: 
+3667:     if initial_contents_view is not None:
  __pyx_t_7 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_7) {
/* … */
    goto __pyx_L9;
  }
+3668:         gen = mus_any.from_ptr(cclm.mus_make_all_pass(feedback,feedforward, size, &initial_contents_view[0], max_size, interp_type))
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L1_error)
    __pyx_t_10 = 0;
    __pyx_t_11 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      __PYX_ERR(0, 3668, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L1_error)
    __pyx_t_12 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L1_error)
    __pyx_t_9 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_all_pass(__pyx_v_feedback, __pyx_v_feedforward, __pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_10 * __pyx_v_initial_contents_view.strides[0]) )))), __pyx_t_11, __pyx_t_12), NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_9);
    __pyx_t_9 = 0;
 3669:     else:
+3670:         gen = mus_any.from_ptr(cclm.mus_make_all_pass(feedback,feedforward, size,NULL, max_size, interp_type))
  /*else*/ {
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3670, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3670, __pyx_L1_error)
    __pyx_t_12 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3670, __pyx_L1_error)
    __pyx_t_9 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_all_pass(__pyx_v_feedback, __pyx_v_feedforward, __pyx_t_11, NULL, __pyx_t_4, __pyx_t_12), NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_9);
    __pyx_t_9 = 0;
  }
  __pyx_L9:;
+3671:     gen.cache_append(initial_contents)
  __pyx_t_9 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+3672:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3673: 
+3674: cpdef cython.double all_pass(gen: mus_any, insig: float, pm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_399all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_all_pass(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_all_pass *__pyx_optional_args) {
  PyObject *__pyx_v_pm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pass", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_pm = __pyx_optional_args->pm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_399all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_398all_pass, "\n    all-pass filter insig value, pm changes the delay length.\n    \n    :param gen: all_pass gen\n    :param insig: input value\n    :param pm: change \\in delay length size. can be + or -\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_399all_pass = {"all_pass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_399all_pass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_398all_pass};
static PyObject *__pyx_pw_8pysndlib_3clm_399all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  PyObject *__pyx_v_pm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pass (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,&__pyx_n_s_pm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3674, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3674, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("all_pass", 0, 2, 3, 1); __PYX_ERR(0, 3674, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3674, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "all_pass") < 0)) __PYX_ERR(0, 3674, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3674, __pyx_L3_error)
    __pyx_v_pm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_pass", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3674, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3674, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_398all_pass(__pyx_self, __pyx_v_gen, __pyx_v_insig, __pyx_v_pm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_398all_pass(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, PyObject *__pyx_v_pm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pass", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.pm = __pyx_v_pm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_all_pass(__pyx_v_gen, __pyx_v_insig, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3674, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3674, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3674, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_pm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3674, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_399all_pass, 0, __pyx_n_s_all_pass, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__436)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_pass, __pyx_t_41) < 0) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__436 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_all_pass, 3674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__436)) __PYX_ERR(0, 3674, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_all_pass {
  int __pyx_n;
  PyObject *pm;
};
 3675:     """
 3676:     all-pass filter insig value, pm changes the delay length.
 3677:     
 3678:     :param gen: all_pass gen
 3679:     :param insig: input value
 3680:     :param pm: change \in delay length size. can be + or -
 3681:     :rtype: float
 3682:     """
+3683:     if pm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3683, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3684:         return cclm.mus_all_pass(gen._ptr, insig, pm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3684, __pyx_L1_error)
    __pyx_r = mus_all_pass(__pyx_v_gen->_ptr, __pyx_v_insig, __pyx_t_2);
    goto __pyx_L0;
 3685:     else:
+3686:         return cclm.mus_all_pass_unmodulated(gen._ptr, insig)
  /*else*/ {
    __pyx_r = mus_all_pass_unmodulated(__pyx_v_gen->_ptr, __pyx_v_insig);
    goto __pyx_L0;
  }
 3687: 
+3688: cpdef is_all_pass(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_401is_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_all_pass(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_all_pass", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_401is_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_400is_all_pass, "\n    returns True if gen is a all_pass.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_401is_all_pass = {"is_all_pass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_401is_all_pass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_400is_all_pass};
static PyObject *__pyx_pw_8pysndlib_3clm_401is_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_all_pass (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3688, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_all_pass") < 0)) __PYX_ERR(0, 3688, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_all_pass", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3688, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3688, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_400is_all_pass(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_400is_all_pass(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_all_pass", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_all_pass(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3688, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_401is_all_pass, 0, __pyx_n_s_is_all_pass, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__437)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_all_pass, __pyx_t_37) < 0) __PYX_ERR(0, 3688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_all_pass, 3688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) __PYX_ERR(0, 3688, __pyx_L1_error)
 3689:     """
 3690:     returns True if gen is a all_pass.
 3691:     
 3692:     :param gen: gen
 3693:     :rtype: bool
 3694:     """
+3695:     return cclm.mus_is_all_pass(gen._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(mus_is_all_pass(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 3696: 
 3697: 
 3698: # ---------------- all-pass-bank ---------------- #
+3699: cpdef mus_any make_all_pass_bank(all_passes: list):
static PyObject *__pyx_pw_8pysndlib_3clm_403make_all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_all_pass_bank(PyObject *__pyx_v_all_passes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any_array *__pyx_v_all_passes_array = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_all_pass_bank", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.make_all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_all_passes_array);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_403make_all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_402make_all_pass_bank, "\n    return a new all_pass-bank generator.\n    \n    :param all_passes: list of all_pass gens\n    :return: all_pass_bank gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_403make_all_pass_bank = {"make_all_pass_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_403make_all_pass_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_402make_all_pass_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_403make_all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_all_passes = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_all_pass_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_all_passes,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_passes)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3699, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_all_pass_bank") < 0)) __PYX_ERR(0, 3699, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_all_passes = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_all_pass_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3699, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_all_passes), (&PyList_Type), 0, "all_passes", 1))) __PYX_ERR(0, 3699, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_402make_all_pass_bank(__pyx_self, __pyx_v_all_passes);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_402make_all_pass_bank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_all_passes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_all_pass_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_all_pass_bank(__pyx_v_all_passes, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__438 = PyTuple_Pack(1, __pyx_n_s_all_passes); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__438);
  __Pyx_GIVEREF(__pyx_tuple__438);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_all_passes, __pyx_n_s_list) < 0) __PYX_ERR(0, 3699, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_403make_all_pass_bank, 0, __pyx_n_s_make_all_pass_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__439)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_all_pass_bank, __pyx_t_41) < 0) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_all_pass_bank, 3699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) __PYX_ERR(0, 3699, __pyx_L1_error)
 3700:     """
 3701:     return a new all_pass-bank generator.
 3702:     
 3703:     :param all_passes: list of all_pass gens
 3704:     :return: all_pass_bank gen
 3705:     :rtype: mus_any
 3706:     """
+3707:     p = list(map(is_all_pass, all_passes))
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_all_pass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_all_passes);
  __Pyx_GIVEREF(__pyx_v_all_passes);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_all_passes);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_p = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
+3708:     if not all(p):
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 3708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (unlikely(__pyx_t_4)) {
/* … */
  }
+3709:         raise TypeError(f'allpass list contains at least one element that is not a all_pass.')
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3709, __pyx_L1_error)
/* … */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_allpass_list_contains_at_least_o); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 3709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
 3710: 
+3711:     all_passes_array = mus_any_array.from_pylist(all_passes)
  __pyx_t_2 = ((PyObject *)__pyx_f_8pysndlib_3clm_13mus_any_array_from_pylist(__pyx_v_all_passes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_all_passes_array = ((struct __pyx_obj_8pysndlib_3clm_mus_any_array *)__pyx_t_2);
  __pyx_t_2 = 0;
+3712:     gen =  mus_any.from_ptr(cclm.mus_make_all_pass_bank(len(all_passes), all_passes_array.data))
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_all_passes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3712, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_all_pass_bank(__pyx_t_5, __pyx_v_all_passes_array->data), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
+3713:     gen.cache_extend([all_passes_array, all_passes])
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_all_passes_array);
  __Pyx_GIVEREF((PyObject *)__pyx_v_all_passes_array);
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_all_passes_array));
  __Pyx_INCREF(__pyx_v_all_passes);
  __Pyx_GIVEREF(__pyx_v_all_passes);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_all_passes);
  __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_extend(__pyx_v_gen, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3714:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3715: 
+3716: cpdef cython.double all_pass_bank(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_405all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_all_pass_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pass_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_405all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_404all_pass_bank, "\n    sum an array of all_pass filters.\n    \n    :param gen: all_pass_bank gen\n    :param inputs: can be a list/array of inputs or a single input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_405all_pass_bank = {"all_pass_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_405all_pass_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_404all_pass_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_405all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pass_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("all_pass_bank", 1, 2, 2, 1); __PYX_ERR(0, 3716, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "all_pass_bank") < 0)) __PYX_ERR(0, 3716, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_pass_bank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3716, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3716, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_404all_pass_bank(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_404all_pass_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_pass_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_all_pass_bank(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3716, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_405all_pass_bank, 0, __pyx_n_s_all_pass_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__440)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_pass_bank, __pyx_t_37) < 0) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__440 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_all_pass_bank, 3716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__440)) __PYX_ERR(0, 3716, __pyx_L1_error)
 3717:     """
 3718:     sum an array of all_pass filters.
 3719:     
 3720:     :param gen: all_pass_bank gen
 3721:     :param inputs: can be a list/array of inputs or a single input
 3722:     :rtype: float
 3723:     """
+3724:     return cclm.mus_all_pass_bank(gen._ptr, insig)
  __pyx_r = mus_all_pass_bank(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3725: 
+3726: cpdef bint is_all_pass_bank(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_407is_all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_all_pass_bank(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_all_pass_bank", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_407is_all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_406is_all_pass_bank, "\n    returns True if gen is a all_pass_bank.\n    \n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_407is_all_pass_bank = {"is_all_pass_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_407is_all_pass_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_406is_all_pass_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_407is_all_pass_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_all_pass_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3726, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_all_pass_bank") < 0)) __PYX_ERR(0, 3726, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_all_pass_bank", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3726, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3726, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_406is_all_pass_bank(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_406is_all_pass_bank(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_all_pass_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_all_pass_bank(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3726, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_all_pass_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3726, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_407is_all_pass_bank, 0, __pyx_n_s_is_all_pass_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__441)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_all_pass_bank, __pyx_t_41) < 0) __PYX_ERR(0, 3726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_all_pass_bank, 3726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) __PYX_ERR(0, 3726, __pyx_L1_error)
 3727:     """
 3728:     returns True if gen is a all_pass_bank.
 3729:     
 3730:     
 3731:     :param gen: gen
 3732:     :rtype: bool
 3733:     """
+3734:     return cclm.mus_is_all_pass_bank(gen._ptr)
  __pyx_r = mus_is_all_pass_bank(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3735: 
 3736: 
 3737: # ---------------- one_pole_all_pass ---------------- #
+3738: cpdef mus_any make_one_pole_all_pass(size: int, coeff: float):
static PyObject *__pyx_pw_8pysndlib_3clm_409make_one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_one_pole_all_pass(PyObject *__pyx_v_size, double __pyx_v_coeff, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_pole_all_pass", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.make_one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_409make_one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_408make_one_pole_all_pass, "\n    return a new one_pole all_pass filter size, coeff.\n    \n    \n    :param size: length \\in samples of the delay line\n    :param coeff: coeff of one pole filter\n    :return: one_pole_all_pass gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_409make_one_pole_all_pass = {"make_one_pole_all_pass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_409make_one_pole_all_pass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_408make_one_pole_all_pass};
static PyObject *__pyx_pw_8pysndlib_3clm_409make_one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_size = 0;
  double __pyx_v_coeff;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_pole_all_pass (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_coeff,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3738, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_coeff)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3738, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_one_pole_all_pass", 1, 2, 2, 1); __PYX_ERR(0, 3738, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_one_pole_all_pass") < 0)) __PYX_ERR(0, 3738, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_size = ((PyObject*)values[0]);
    __pyx_v_coeff = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_coeff == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3738, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_one_pole_all_pass", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3738, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3738, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_408make_one_pole_all_pass(__pyx_self, __pyx_v_size, __pyx_v_coeff);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_408make_one_pole_all_pass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, double __pyx_v_coeff) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_one_pole_all_pass", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_one_pole_all_pass(__pyx_v_size, __pyx_v_coeff, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__442 = PyTuple_Pack(2, __pyx_n_s_size, __pyx_n_s_coeff); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__442);
  __Pyx_GIVEREF(__pyx_tuple__442);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3738, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_coeff, __pyx_n_s_float) < 0) __PYX_ERR(0, 3738, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_409make_one_pole_all_pass, 0, __pyx_n_s_make_one_pole_all_pass, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__443)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_one_pole_all_pass, __pyx_t_37) < 0) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_one_pole_all_pass, 3738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) __PYX_ERR(0, 3738, __pyx_L1_error)
 3739:     """
 3740:     return a new one_pole all_pass filter size, coeff.
 3741:     
 3742:     
 3743:     :param size: length \in samples of the delay line
 3744:     :param coeff: coeff of one pole filter
 3745:     :return: one_pole_all_pass gen
 3746:     :rtype: mus_any
 3747:     """
+3748:     return mus_any.from_ptr(cclm.mus_make_one_pole_all_pass(size, coeff))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3748, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_one_pole_all_pass(__pyx_t_1, __pyx_v_coeff), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;
 3749: 
+3750: cpdef cython.double one_pole_all_pass(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_411one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_one_pole_all_pass(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_pole_all_pass", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_411one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_410one_pole_all_pass, "\n    one pole all pass filter of input.\n    \n    :param gen: one_pole_all_pass gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_411one_pole_all_pass = {"one_pole_all_pass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_411one_pole_all_pass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_410one_pole_all_pass};
static PyObject *__pyx_pw_8pysndlib_3clm_411one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_pole_all_pass (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("one_pole_all_pass", 1, 2, 2, 1); __PYX_ERR(0, 3750, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "one_pole_all_pass") < 0)) __PYX_ERR(0, 3750, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("one_pole_all_pass", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3750, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3750, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_410one_pole_all_pass(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_410one_pole_all_pass(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one_pole_all_pass", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_one_pole_all_pass(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3750, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3750, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3750, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_411one_pole_all_pass, 0, __pyx_n_s_one_pole_all_pass, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__444)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_one_pole_all_pass, __pyx_t_41) < 0) __PYX_ERR(0, 3750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__444 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_one_pole_all_pass, 3750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__444)) __PYX_ERR(0, 3750, __pyx_L1_error)
 3751:     """
 3752:     one pole all pass filter of input.
 3753:     
 3754:     :param gen: one_pole_all_pass gen
 3755:     :param insig: input value
 3756:     :rtype: float
 3757:     """
+3758:     return cclm.mus_one_pole_all_pass(gen._ptr, insig)
  __pyx_r = mus_one_pole_all_pass(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3759: 
+3760: cpdef bint is_one_pole_all_pass(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_413is_one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_one_pole_all_pass(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_pole_all_pass", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_413is_one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_412is_one_pole_all_pass, "\n    returns True if gen is a one_pole_all_pass.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_413is_one_pole_all_pass = {"is_one_pole_all_pass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_413is_one_pole_all_pass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_412is_one_pole_all_pass};
static PyObject *__pyx_pw_8pysndlib_3clm_413is_one_pole_all_pass(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_pole_all_pass (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3760, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_one_pole_all_pass") < 0)) __PYX_ERR(0, 3760, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_one_pole_all_pass", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3760, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3760, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_412is_one_pole_all_pass(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_412is_one_pole_all_pass(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_one_pole_all_pass", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_one_pole_all_pass(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3760, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_one_pole_all_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3760, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_413is_one_pole_all_pass, 0, __pyx_n_s_is_one_pole_all_pass, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__445)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_one_pole_all_pass, __pyx_t_37) < 0) __PYX_ERR(0, 3760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_one_pole_all_pass, 3760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) __PYX_ERR(0, 3760, __pyx_L1_error)
 3761:     """
 3762:     returns True if gen is a one_pole_all_pass.
 3763:     
 3764:     :param gen: gen
 3765:     :rtype: bool
 3766:     """
+3767:     return cclm.mus_is_one_pole_all_pass(gen._ptr)
  __pyx_r = mus_is_one_pole_all_pass(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3768: 
 3769: # ---------------- moving-average ---------------- #
+3770: cpdef mus_any make_moving_average(size: int, initial_contents=None, initial_element: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_415make_moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_moving_average(PyObject *__pyx_v_size, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_moving_average *__pyx_optional_args) {
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
  PyObject *__pyx_v_initial_element = ((PyObject *)__pyx_float_0_0);
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_average", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_element = __pyx_optional_args->initial_element;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.make_moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_415make_moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_414make_moving_average, "\n    return a new moving_average generator. \n    \n    :param size: averaging length \\in samples\n    :param initial_contents: initial values\n    :param initial_element: initial element\n    :return: moving_average gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_415make_moving_average = {"make_moving_average", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_415make_moving_average, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_414make_moving_average};
static PyObject *__pyx_pw_8pysndlib_3clm_415make_moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_average (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3770, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3770, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3770, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_moving_average") < 0)) __PYX_ERR(0, 3770, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = ((PyObject*)values[0]);
    __pyx_v_initial_contents = values[1];
    __pyx_v_initial_element = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_moving_average", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 3770, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3770, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_414make_moving_average(__pyx_self, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_initial_element);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_414make_moving_average(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_average", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_moving_average(__pyx_v_size, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__446 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_initial_contents, __pyx_n_s_initial_element); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__446);
  __Pyx_GIVEREF(__pyx_tuple__446);
  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_moving_average, 3770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) __PYX_ERR(0, 3770, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3770, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_initial_element, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3770, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_415make_moving_average, 0, __pyx_n_s_make_moving_average, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__447)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__448);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_moving_average, __pyx_t_41) < 0) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__448 = PyTuple_Pack(2, Py_None, __pyx_float_0_0); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__448);
  __Pyx_GIVEREF(__pyx_tuple__448);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_moving_average {
  int __pyx_n;
  PyObject *initial_contents;
  PyObject *initial_element;
};
 3771:     """
 3772:     return a new moving_average generator. 
 3773:     
 3774:     :param size: averaging length \in samples
 3775:     :param initial_contents: initial values
 3776:     :param initial_element: initial element
 3777:     :return: moving_average gen
 3778:     :rtype: mus_any
 3779:     """
 3780: 
+3781:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3782: 
+3783:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3783, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3784: 
+3785:     if initial_contents is not None:
  __pyx_t_6 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_6) {
/* … */
    goto __pyx_L3;
  }
+3786:         if isinstance(initial_contents, list):
    __pyx_t_6 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_6) {
/* … */
    }
+3787:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_1);
      __pyx_t_1 = 0;
+3788:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3789:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3789, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3790:     else:
+3791:         initial_contents = np.zeros(size, dtype=np.double)
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_8);
    __pyx_t_8 = 0;
+3792:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+3793:         initial_contents.fill(initial_element)
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_element};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+3794:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3794, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
  }
  __pyx_L3:;
 3795: 
+3796:     if initial_contents_view is not None:
  __pyx_t_6 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_6) {
/* … */
  }
+3797:         gen = mus_any.from_ptr(cclm.mus_make_moving_average(size, &initial_contents_view[0]))
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3797, __pyx_L1_error)
    __pyx_t_9 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      __PYX_ERR(0, 3797, __pyx_L1_error)
    }
    __pyx_t_8 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_moving_average(__pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_9 * __pyx_v_initial_contents_view.strides[0]) ))))), NULL)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_8);
    __pyx_t_8 = 0;
 3798: 
+3799:     gen.cache_append(initial_contents)
  if (unlikely(!__pyx_v_gen)) { __Pyx_RaiseUnboundLocalError("gen"); __PYX_ERR(0, 3799, __pyx_L1_error) }
  __pyx_t_8 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+3800:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(!__pyx_v_gen)) { __Pyx_RaiseUnboundLocalError("gen"); __PYX_ERR(0, 3800, __pyx_L1_error) }
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3801: 
 3802: 
+3803: cpdef cython.double moving_average(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_417moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_moving_average(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_average", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_417moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_416moving_average, "\n    moving window average.\n    \n    :param gen: moving_average gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_417moving_average = {"moving_average", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_417moving_average, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_416moving_average};
static PyObject *__pyx_pw_8pysndlib_3clm_417moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_average (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3803, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3803, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("moving_average", 1, 2, 2, 1); __PYX_ERR(0, 3803, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "moving_average") < 0)) __PYX_ERR(0, 3803, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3803, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("moving_average", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3803, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3803, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_416moving_average(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_416moving_average(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_average", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_moving_average(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3803, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3803, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3803, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_417moving_average, 0, __pyx_n_s_moving_average, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__449)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_moving_average, __pyx_t_37) < 0) __PYX_ERR(0, 3803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_moving_average, 3803, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) __PYX_ERR(0, 3803, __pyx_L1_error)
 3804:     """
 3805:     moving window average.
 3806:     
 3807:     :param gen: moving_average gen
 3808:     :param insig: input value
 3809:     :rtype: float
 3810:     """
+3811:     return cclm.mus_moving_average(gen._ptr, insig)
  __pyx_r = mus_moving_average(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3812: 
+3813: cpdef bint is_moving_average(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_419is_moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_moving_average(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_average", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_419is_moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_418is_moving_average, "\n    returns True if gen is a moving_average.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_419is_moving_average = {"is_moving_average", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_419is_moving_average, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_418is_moving_average};
static PyObject *__pyx_pw_8pysndlib_3clm_419is_moving_average(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_average (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3813, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_moving_average") < 0)) __PYX_ERR(0, 3813, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_moving_average", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3813, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3813, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_418is_moving_average(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_418is_moving_average(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_average", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_moving_average(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3813, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_moving_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3813, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_419is_moving_average, 0, __pyx_n_s_is_moving_average, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__450)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_moving_average, __pyx_t_41) < 0) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__450 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_moving_average, 3813, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__450)) __PYX_ERR(0, 3813, __pyx_L1_error)
 3814:     """
 3815:     returns True if gen is a moving_average.
 3816:     
 3817:     :param gen: gen
 3818:     :rtype: bool
 3819:     """
+3820:     return cclm.mus_is_moving_average(gen._ptr)
  __pyx_r = mus_is_moving_average(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3821: 
 3822: # ---------------- moving-max ---------------- #
+3823: cpdef mus_any make_moving_max(size: int,
static PyObject *__pyx_pw_8pysndlib_3clm_421make_moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_moving_max(PyObject *__pyx_v_size, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_moving_max *__pyx_optional_args) {
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.make_moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_421make_moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_420make_moving_max, "\n    return a new moving-max generator.\n    \n    :param size: max window length \\in samples\n    :param initial_contents: initial values\n    :param initial_element: initial element\n    :return: moving_max gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_421make_moving_max = {"make_moving_max", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_421make_moving_max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_420make_moving_max};
static PyObject *__pyx_pw_8pysndlib_3clm_421make_moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_initial_element = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_max (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_initial_element,0};
    PyObject* values[3] = {0,0,0};
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_420make_moving_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_initial_element) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.initial_element = __pyx_v_initial_element;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_moving_max(__pyx_v_size, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_moving_max, 3823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) __PYX_ERR(0, 3823, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3823, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_initial_element, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3823, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_421make_moving_max, 0, __pyx_n_s_make_moving_max, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__451)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__452);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_moving_max, __pyx_t_37) < 0) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__452 = PyTuple_Pack(2, Py_None, __pyx_float_0_0); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__452);
  __Pyx_GIVEREF(__pyx_tuple__452);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_moving_max {
  int __pyx_n;
  PyObject *initial_contents;
  PyObject *initial_element;
};
+3824:                 initial_contents=None,
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
  PyObject *__pyx_v_initial_element = ((PyObject *)__pyx_float_0_0);
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_max", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_initial_element = __pyx_optional_args->initial_element;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
/* … */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3823, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_element);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3823, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_moving_max") < 0)) __PYX_ERR(0, 3823, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = ((PyObject*)values[0]);
    __pyx_v_initial_contents = values[1];
    __pyx_v_initial_element = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_moving_max", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 3823, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3823, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_420make_moving_max(__pyx_self, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_initial_element);
 3825:                 initial_element: Optional[float]=0.0):
 3826:                 
 3827:     """
 3828:     return a new moving-max generator.
 3829:     
 3830:     :param size: max window length \in samples
 3831:     :param initial_contents: initial values
 3832:     :param initial_element: initial element
 3833:     :return: moving_max gen
 3834:     :rtype: mus_any
 3835:     """
 3836: 
+3837:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3838: 
+3839:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3839, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3840: 
+3841:     if initial_contents is not None:
  __pyx_t_6 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_6) {
/* … */
    goto __pyx_L3;
  }
+3842:         if isinstance(initial_contents, list):
    __pyx_t_6 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_6) {
/* … */
    }
+3843:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3843, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_1);
      __pyx_t_1 = 0;
+3844:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3845:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3845, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3846: 
+3847:     elif initial_element:
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_initial_element); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3847, __pyx_L1_error)
  if (__pyx_t_6) {
/* … */
  }
  __pyx_L3:;
+3848:         initial_contents = np.zeros(size, dtype=np.double)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_8);
    __pyx_t_8 = 0;
+3849:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_contents};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+3850:         initial_contents.fill(initial_element)
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_initial_contents, __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_initial_element};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3850, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+3851:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3851, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
+3852:     if initial_contents_view is not None:
  __pyx_t_6 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_6) {
/* … */
    goto __pyx_L5;
  }
+3853:         gen = mus_any.from_ptr(cclm.mus_make_moving_max(size, &initial_contents_view[0]))
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3853, __pyx_L1_error)
    __pyx_t_9 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      __PYX_ERR(0, 3853, __pyx_L1_error)
    }
    __pyx_t_8 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_moving_max(__pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_9 * __pyx_v_initial_contents_view.strides[0]) ))))), NULL)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_8);
    __pyx_t_8 = 0;
+3854:         gen.cache_append(initial_contents)
    __pyx_t_8 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 3855:     else:
+3856:         gen = mus_any.from_ptr(cclm.mus_make_moving_max(size, NULL))
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3856, __pyx_L1_error)
    __pyx_t_8 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_moving_max(__pyx_t_4, NULL), NULL)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_8);
    __pyx_t_8 = 0;
  }
  __pyx_L5:;
+3857:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3858: 
+3859: cpdef cython.double moving_max(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_423moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_moving_max(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_max", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_423moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_422moving_max, "\n    moving window max.\n    \n    :param gen: moving_max gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_423moving_max = {"moving_max", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_423moving_max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_422moving_max};
static PyObject *__pyx_pw_8pysndlib_3clm_423moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_max (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("moving_max", 1, 2, 2, 1); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "moving_max") < 0)) __PYX_ERR(0, 3859, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("moving_max", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3859, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_422moving_max(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_422moving_max(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_moving_max(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3859, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3859, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_423moving_max, 0, __pyx_n_s_moving_max, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__453)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_moving_max, __pyx_t_41) < 0) __PYX_ERR(0, 3859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_moving_max, 3859, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) __PYX_ERR(0, 3859, __pyx_L1_error)
 3860:     """
 3861:     moving window max.
 3862:     
 3863:     :param gen: moving_max gen
 3864:     :param insig: input value
 3865:     :rtype: float
 3866:     """
+3867:     return cclm.mus_moving_max(gen._ptr, insig)
  __pyx_r = mus_moving_max(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3868: 
+3869: cpdef bint is_moving_max(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_425is_moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_moving_max(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_max", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_425is_moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_424is_moving_max, "\n    returns True if gen is a moving_max.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_425is_moving_max = {"is_moving_max", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_425is_moving_max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_424is_moving_max};
static PyObject *__pyx_pw_8pysndlib_3clm_425is_moving_max(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_max (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3869, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_moving_max") < 0)) __PYX_ERR(0, 3869, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_moving_max", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3869, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3869, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_424is_moving_max(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_424is_moving_max(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_moving_max(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3869, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_moving_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3869, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_425is_moving_max, 0, __pyx_n_s_is_moving_max, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__454)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_moving_max, __pyx_t_37) < 0) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__454 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_moving_max, 3869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__454)) __PYX_ERR(0, 3869, __pyx_L1_error)
 3870:     """
 3871:     returns True if gen is a moving_max.
 3872:     
 3873:     :param gen: gen
 3874:     :rtype: bool
 3875:     """
+3876:     return cclm.mus_is_moving_max(gen._ptr)
  __pyx_r = mus_is_moving_max(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3877: 
 3878: # ---------------- moving-norm ---------------- #
+3879: cpdef mus_any make_moving_norm(size: int, initial_contents=None, scaler: Optional[float]=1.):
static PyObject *__pyx_pw_8pysndlib_3clm_427make_moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_moving_norm(PyObject *__pyx_v_size, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_moving_norm *__pyx_optional_args) {
  PyObject *__pyx_v_initial_contents = ((PyObject *)Py_None);
  PyObject *__pyx_v_scaler = ((PyObject *)__pyx_float_1_);
  __Pyx_memviewslice __pyx_v_initial_contents_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_norm", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_contents = __pyx_optional_args->initial_contents;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_scaler = __pyx_optional_args->scaler;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_initial_contents);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_AddTraceback("pysndlib.clm.make_moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
  __Pyx_XDECREF((PyObject *)__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_initial_contents);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_427make_moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_426make_moving_norm, "\n    return a new moving-norm generator.\n    \n    :param size: averaging length \\in samples\n    :param initial_contents: initial values\n    :param scaler: normalzing value\n    :return: moving_norm gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_427make_moving_norm = {"make_moving_norm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_427make_moving_norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_426make_moving_norm};
static PyObject *__pyx_pw_8pysndlib_3clm_427make_moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_initial_contents = 0;
  PyObject *__pyx_v_scaler = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_norm (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_initial_contents,&__pyx_n_s_scaler,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_float_1_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_contents);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scaler);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_moving_norm") < 0)) __PYX_ERR(0, 3879, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = ((PyObject*)values[0]);
    __pyx_v_initial_contents = values[1];
    __pyx_v_scaler = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_moving_norm", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 3879, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyInt_Type), 0, "size", 1))) __PYX_ERR(0, 3879, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_426make_moving_norm(__pyx_self, __pyx_v_size, __pyx_v_initial_contents, __pyx_v_scaler);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_426make_moving_norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, PyObject *__pyx_v_initial_contents, PyObject *__pyx_v_scaler) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_moving_norm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.initial_contents = __pyx_v_initial_contents;
  __pyx_t_2.scaler = __pyx_v_scaler;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_moving_norm(__pyx_v_size, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__455 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_initial_contents, __pyx_n_s_scaler); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__455);
  __Pyx_GIVEREF(__pyx_tuple__455);
  __pyx_codeobj__456 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__455, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_moving_norm, 3879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__456)) __PYX_ERR(0, 3879, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_size, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3879, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_scaler, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3879, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_427make_moving_norm, 0, __pyx_n_s_make_moving_norm, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__456)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__457);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_moving_norm, __pyx_t_41) < 0) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__457 = PyTuple_Pack(2, Py_None, __pyx_float_1_); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__457);
  __Pyx_GIVEREF(__pyx_tuple__457);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_moving_norm {
  int __pyx_n;
  PyObject *initial_contents;
  PyObject *scaler;
};
 3880:     """
 3881:     return a new moving-norm generator.
 3882:     
 3883:     :param size: averaging length \in samples
 3884:     :param initial_contents: initial values
 3885:     :param scaler: normalzing value
 3886:     :return: moving_norm gen
 3887:     :rtype: mus_any
 3888:     """
 3889: 
+3890:     check_range('size', size, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_size, __pyx_v_size, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3891: 
+3892:     cdef double [:] initial_contents_view = None
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3892, __pyx_L1_error)
  __pyx_v_initial_contents_view = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;
 3893: 
 3894: 
+3895:     if initial_contents is not None:
  __pyx_t_6 = (__pyx_v_initial_contents != Py_None);
  if (__pyx_t_6) {
/* … */
  }
+3896:         if isinstance(initial_contents, list):
    __pyx_t_6 = PyList_Check(__pyx_v_initial_contents); 
    if (__pyx_t_6) {
/* … */
    }
+3897:             initial_contents = np.array(initial_contents)
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_initial_contents, __pyx_t_1);
      __pyx_t_1 = 0;
+3898:         check_ndim(initial_contents)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_initial_contents};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3899:         initial_contents_view = initial_contents
    __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_initial_contents, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 3899, __pyx_L1_error)
    __PYX_XCLEAR_MEMVIEW(&__pyx_v_initial_contents_view, 1);
    __pyx_v_initial_contents_view = __pyx_t_5;
    __pyx_t_5.memview = NULL;
    __pyx_t_5.data = NULL;
 3900: 
+3901:     if initial_contents_view is not None:
  __pyx_t_6 = (((PyObject *) __pyx_v_initial_contents_view.memview) != Py_None);
  if (__pyx_t_6) {
/* … */
    goto __pyx_L5;
  }
+3902:         gen = mus_any.from_ptr(cclm.mus_make_moving_norm(size, &initial_contents_view[0], scaler))
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3902, __pyx_L1_error)
    __pyx_t_7 = 0;
    __pyx_t_8 = -1;
    if (__pyx_t_7 < 0) {
      __pyx_t_7 += __pyx_v_initial_contents_view.shape[0];
      if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_7 >= __pyx_v_initial_contents_view.shape[0])) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(0, 3902, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_scaler); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3902, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_moving_norm(__pyx_t_4, (&(*((double *) ( /* dim=0 */ (__pyx_v_initial_contents_view.data + __pyx_t_7 * __pyx_v_initial_contents_view.strides[0]) )))), __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
+3903:         gen.cache_append(initial_contents)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_gen->__pyx_vtab)->cache_append(__pyx_v_gen, __pyx_v_initial_contents, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3904:     else:
+3905:         gen = mus_any.from_ptr(cclm.mus_make_moving_norm(size, NULL, scaler))
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3905, __pyx_L1_error)
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_scaler); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3905, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_moving_norm(__pyx_t_4, NULL, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L5:;
 3906: 
+3907:     return gen
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 3908: 
+3909: cpdef cython.double moving_norm(gen: mus_any, insig: float):
static PyObject *__pyx_pw_8pysndlib_3clm_429moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_moving_norm(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_norm", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_429moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_428moving_norm, "\n    moving window norm.\n    \n    :param gen: moving_norm gen\n    :param insig: input value\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_429moving_norm = {"moving_norm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_429moving_norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_428moving_norm};
static PyObject *__pyx_pw_8pysndlib_3clm_429moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_insig;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_norm (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_insig,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3909, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insig)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3909, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("moving_norm", 1, 2, 2, 1); __PYX_ERR(0, 3909, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "moving_norm") < 0)) __PYX_ERR(0, 3909, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_insig = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_insig == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3909, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("moving_norm", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3909, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3909, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_428moving_norm(__pyx_self, __pyx_v_gen, __pyx_v_insig);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_428moving_norm(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_insig) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moving_norm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_moving_norm(__pyx_v_gen, __pyx_v_insig, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3909, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3909, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_insig, __pyx_n_s_float) < 0) __PYX_ERR(0, 3909, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_429moving_norm, 0, __pyx_n_s_moving_norm, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__458)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_moving_norm, __pyx_t_37) < 0) __PYX_ERR(0, 3909, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__458 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_moving_norm, 3909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__458)) __PYX_ERR(0, 3909, __pyx_L1_error)
 3910:     """
 3911:     moving window norm.
 3912:     
 3913:     :param gen: moving_norm gen
 3914:     :param insig: input value
 3915:     :rtype: float
 3916:     """
+3917:     return cclm.mus_moving_norm(gen._ptr, insig)
  __pyx_r = mus_moving_norm(__pyx_v_gen->_ptr, __pyx_v_insig);
  goto __pyx_L0;
 3918: 
+3919: cpdef is_moving_norm(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_431is_moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_moving_norm(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_norm", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_431is_moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_430is_moving_norm, "\n    returns True if gen is a moving_norm.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_431is_moving_norm = {"is_moving_norm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_431is_moving_norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_430is_moving_norm};
static PyObject *__pyx_pw_8pysndlib_3clm_431is_moving_norm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_norm (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3919, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_moving_norm") < 0)) __PYX_ERR(0, 3919, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_moving_norm", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3919, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3919, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_430is_moving_norm(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_430is_moving_norm(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_moving_norm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_moving_norm(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_moving_norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3919, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_431is_moving_norm, 0, __pyx_n_s_is_moving_norm, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__459)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_moving_norm, __pyx_t_41) < 0) __PYX_ERR(0, 3919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__459 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_moving_norm, 3919, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__459)) __PYX_ERR(0, 3919, __pyx_L1_error)
 3920:     """
 3921:     returns True if gen is a moving_norm.
 3922:     
 3923:     :param gen: gen
 3924:     :rtype: bool
 3925:     """
+3926:     return cclm.mus_is_moving_norm(gen._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(mus_is_moving_norm(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 3927: 
 3928: 
 3929: # ---------------- asymmetric-fm ---------------- #
+3930: cpdef mus_any make_asymmetric_fm(frequency: float, initial_phase: Optional[float]=0.0, r: Optional[float]=1.0, ratio: Optional[float]=1.):
static PyObject *__pyx_pw_8pysndlib_3clm_433make_asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_asymmetric_fm(double __pyx_v_frequency, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_asymmetric_fm *__pyx_optional_args) {
  PyObject *__pyx_v_initial_phase = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_r = ((PyObject *)__pyx_float_1_0);
  PyObject *__pyx_v_ratio = ((PyObject *)__pyx_float_1_);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_asymmetric_fm", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_initial_phase = __pyx_optional_args->initial_phase;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_r = __pyx_optional_args->r;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ratio = __pyx_optional_args->ratio;
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_433make_asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_432make_asymmetric_fm, "\n    return a new asymmetric_fm generator.\n    \n    :param frequency: frequency of gen\n    :param initial_phase: starting phase of gen, \\in radians\n    :param r: amplitude ratio between successive sidebands\n    :param ratio: ratio between carrier and sideband spacing\n    :return: asymmetric_fm gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_433make_asymmetric_fm = {"make_asymmetric_fm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_433make_asymmetric_fm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_432make_asymmetric_fm};
static PyObject *__pyx_pw_8pysndlib_3clm_433make_asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  double __pyx_v_frequency;
  PyObject *__pyx_v_initial_phase = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_ratio = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_asymmetric_fm (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_initial_phase,&__pyx_n_s_r,&__pyx_n_s_ratio,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_float_0_0);
    values[2] = ((PyObject *)__pyx_float_1_0);
    values[3] = ((PyObject *)__pyx_float_1_);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_frequency)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial_phase);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ratio);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_asymmetric_fm") < 0)) __PYX_ERR(0, 3930, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_frequency = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_frequency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
    __pyx_v_initial_phase = values[1];
    __pyx_v_r = values[2];
    __pyx_v_ratio = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_asymmetric_fm", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 3930, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_432make_asymmetric_fm(__pyx_self, __pyx_v_frequency, __pyx_v_initial_phase, __pyx_v_r, __pyx_v_ratio);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_432make_asymmetric_fm(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_frequency, PyObject *__pyx_v_initial_phase, PyObject *__pyx_v_r, PyObject *__pyx_v_ratio) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_asymmetric_fm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.initial_phase = __pyx_v_initial_phase;
  __pyx_t_2.r = __pyx_v_r;
  __pyx_t_2.ratio = __pyx_v_ratio;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_asymmetric_fm(__pyx_v_frequency, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__460 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_initial_phase, __pyx_n_s_r, __pyx_n_s_ratio); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__460);
  __Pyx_GIVEREF(__pyx_tuple__460);
  __pyx_codeobj__461 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__460, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_asymmetric_fm, 3930, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__461)) __PYX_ERR(0, 3930, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_frequency, __pyx_n_s_float) < 0) __PYX_ERR(0, 3930, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_initial_phase, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3930, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_r, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3930, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_ratio, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3930, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_433make_asymmetric_fm, 0, __pyx_n_s_make_asymmetric_fm, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__461)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__462);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_asymmetric_fm, __pyx_t_37) < 0) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__462 = PyTuple_Pack(3, __pyx_float_0_0, __pyx_float_1_0, __pyx_float_1_); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__462);
  __Pyx_GIVEREF(__pyx_tuple__462);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_asymmetric_fm {
  int __pyx_n;
  PyObject *initial_phase;
  PyObject *r;
  PyObject *ratio;
};
 3931:     """
 3932:     return a new asymmetric_fm generator.
 3933:     
 3934:     :param frequency: frequency of gen
 3935:     :param initial_phase: starting phase of gen, \in radians
 3936:     :param r: amplitude ratio between successive sidebands
 3937:     :param ratio: ratio between carrier and sideband spacing
 3938:     :return: asymmetric_fm gen
 3939:     :rtype: mus_any
 3940:     """
 3941: 
+3942:     check_range('frequency', frequency, 0.0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_frequency); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_n_s_frequency, __pyx_t_3, __pyx_float_0_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 3943: 
+3944:     return mus_any.from_ptr(cclm.mus_make_asymmetric_fm(frequency, initial_phase, r, ratio))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_initial_phase); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3944, __pyx_L1_error)
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_r); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3944, __pyx_L1_error)
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_ratio); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3944, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_asymmetric_fm(__pyx_v_frequency, __pyx_t_6, __pyx_t_7, __pyx_t_8), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 3945: 
+3946: cpdef cython.double asymmetric_fm(gen: mus_any, index: float, fm: Optional[float]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_435asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_asymmetric_fm(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_asymmetric_fm *__pyx_optional_args) {
  PyObject *__pyx_v_fm = ((PyObject *)Py_None);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asymmetric_fm", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fm = __pyx_optional_args->fm;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_435asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_434asymmetric_fm, "\n    next sample from asymmetric fm generator.  \n       \n    :param gen: asymmetric_fm gen\n    :param index: fm index\n    :param fm: fm input\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_435asymmetric_fm = {"asymmetric_fm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_435asymmetric_fm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_434asymmetric_fm};
static PyObject *__pyx_pw_8pysndlib_3clm_435asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_index;
  PyObject *__pyx_v_fm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asymmetric_fm (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_index,&__pyx_n_s_fm,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("asymmetric_fm", 0, 2, 3, 1); __PYX_ERR(0, 3946, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "asymmetric_fm") < 0)) __PYX_ERR(0, 3946, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_index = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_index == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L3_error)
    __pyx_v_fm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("asymmetric_fm", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3946, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3946, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_434asymmetric_fm(__pyx_self, __pyx_v_gen, __pyx_v_index, __pyx_v_fm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_434asymmetric_fm(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_index, PyObject *__pyx_v_fm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asymmetric_fm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fm = __pyx_v_fm;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_asymmetric_fm(__pyx_v_gen, __pyx_v_index, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3946, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_index, __pyx_n_s_float) < 0) __PYX_ERR(0, 3946, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_fm, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 3946, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_435asymmetric_fm, 0, __pyx_n_s_asymmetric_fm, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__463)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asymmetric_fm, __pyx_t_41) < 0) __PYX_ERR(0, 3946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__463 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_asymmetric_fm, 3946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__463)) __PYX_ERR(0, 3946, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_asymmetric_fm {
  int __pyx_n;
  PyObject *fm;
};
 3947:     """
 3948:     next sample from asymmetric fm generator.  
 3949:        
 3950:     :param gen: asymmetric_fm gen
 3951:     :param index: fm index
 3952:     :param fm: fm input
 3953:     :rtype: float
 3954:     """
+3955:     if fm:
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3955, __pyx_L1_error)
  if (__pyx_t_1) {
/* … */
  }
+3956:         return cclm.mus_asymmetric_fm(gen._ptr, index, fm)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_fm); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3956, __pyx_L1_error)
    __pyx_r = mus_asymmetric_fm(__pyx_v_gen->_ptr, __pyx_v_index, __pyx_t_2);
    goto __pyx_L0;
 3957:     else:
+3958:         return cclm.mus_asymmetric_fm_unmodulated(gen._ptr, index)
  /*else*/ {
    __pyx_r = mus_asymmetric_fm_unmodulated(__pyx_v_gen->_ptr, __pyx_v_index);
    goto __pyx_L0;
  }
 3959: 
+3960: cpdef bint is_asymmetric_fm(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_437is_asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_asymmetric_fm(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_asymmetric_fm", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_437is_asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_436is_asymmetric_fm, "\n    returns True if gen is a asymmetric_fm.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_437is_asymmetric_fm = {"is_asymmetric_fm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_437is_asymmetric_fm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_436is_asymmetric_fm};
static PyObject *__pyx_pw_8pysndlib_3clm_437is_asymmetric_fm(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_asymmetric_fm (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3960, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_asymmetric_fm") < 0)) __PYX_ERR(0, 3960, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_asymmetric_fm", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3960, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3960, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_436is_asymmetric_fm(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_436is_asymmetric_fm(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_asymmetric_fm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_asymmetric_fm(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3960, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_asymmetric_fm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3960, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_437is_asymmetric_fm, 0, __pyx_n_s_is_asymmetric_fm, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__464)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_asymmetric_fm, __pyx_t_37) < 0) __PYX_ERR(0, 3960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__464 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_asymmetric_fm, 3960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__464)) __PYX_ERR(0, 3960, __pyx_L1_error)
 3961:     """
 3962:     returns True if gen is a asymmetric_fm.
 3963:     
 3964:     :param gen: gen
 3965:     :rtype: bool
 3966:     """
+3967:     return cclm.mus_is_asymmetric_fm(gen._ptr)
  __pyx_r = mus_is_asymmetric_fm(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 3968: 
 3969: # ---------------- file-to-sample ---------------- #
+3970: cpdef mus_any make_file2sample(filename, buffer_size: Optional[int]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_439make_file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_file2sample(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_file2sample *__pyx_optional_args) {
  PyObject *__pyx_v_buffer_size = ((PyObject *)Py_None);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_file2sample", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_buffer_size = __pyx_optional_args->buffer_size;
    }
  }
  __Pyx_INCREF(__pyx_v_buffer_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_439make_file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_438make_file2sample, "\n    return an input generator reading 'filename' (a sound file).\n    \n    :param filename: name of file to read\n    :param buffer_size: io buffer size\n    :return: file2sample gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_439make_file2sample = {"make_file2sample", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_439make_file2sample, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_438make_file2sample};
static PyObject *__pyx_pw_8pysndlib_3clm_439make_file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_buffer_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_file2sample (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_buffer_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3970, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer_size);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3970, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_file2sample") < 0)) __PYX_ERR(0, 3970, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_buffer_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_file2sample", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 3970, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_438make_file2sample(__pyx_self, __pyx_v_filename, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_438make_file2sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_file2sample", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.buffer_size = __pyx_v_buffer_size;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_file2sample(__pyx_v_filename, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__465 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_buffer_size); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(0, 3970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__465);
  __Pyx_GIVEREF(__pyx_tuple__465);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_buffer_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3970, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_439make_file2sample, 0, __pyx_n_s_make_file2sample, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__466)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_file2sample, __pyx_t_41) < 0) __PYX_ERR(0, 3970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__466 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_file2sample, 3970, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__466)) __PYX_ERR(0, 3970, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_file2sample {
  int __pyx_n;
  PyObject *buffer_size;
};
 3971:     """
 3972:     return an input generator reading 'filename' (a sound file).
 3973:     
 3974:     :param filename: name of file to read
 3975:     :param buffer_size: io buffer size
 3976:     :return: file2sample gen
 3977:     :rtype: mus_any
 3978:     """
+3979:     buffer_size = buffer_size or CLM.buffer_size
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3979, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_1 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_buffer_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_1);
  __pyx_t_1 = 0;
+3980:     return mus_any.from_ptr(cclm.mus_make_file_to_sample_with_buffer_size(filename, buffer_size))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 3980, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyInt_As_mus_long_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_6 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3980, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_file_to_sample_with_buffer_size(__pyx_t_5, __pyx_t_6), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 3981: 
+3982: cpdef cython.double file2sample(gen: mus_any, loc: int, chan: Optional[int]=0):
static PyObject *__pyx_pw_8pysndlib_3clm_441file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_file2sample(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_loc, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_file2sample *__pyx_optional_args) {
  PyObject *__pyx_v_chan = ((PyObject *)__pyx_int_0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2sample", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_chan = __pyx_optional_args->chan;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_441file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_440file2sample, "\n    sample value \\in sound file read by 'obj' \\in channel chan at sample.\n    \n    :param gen: file2sample gen\n    :param loc: location \\in file to read\n    :param chan: channel to read\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_441file2sample = {"file2sample", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_441file2sample, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_440file2sample};
static PyObject *__pyx_pw_8pysndlib_3clm_441file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_v_chan = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2sample (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_loc,&__pyx_n_s_chan,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_int_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("file2sample", 0, 2, 3, 1); __PYX_ERR(0, 3982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "file2sample") < 0)) __PYX_ERR(0, 3982, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_loc = ((PyObject*)values[1]);
    __pyx_v_chan = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("file2sample", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 3982, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3982, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 3982, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_440file2sample(__pyx_self, __pyx_v_gen, __pyx_v_loc, __pyx_v_chan);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_440file2sample(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_loc, PyObject *__pyx_v_chan) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2sample", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.chan = __pyx_v_chan;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_file2sample(__pyx_v_gen, __pyx_v_loc, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__467 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_loc, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__467);
  __Pyx_GIVEREF(__pyx_tuple__467);
  __pyx_codeobj__468 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_file2sample, 3982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__468)) __PYX_ERR(0, 3982, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3982, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 3982, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_chan, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 3982, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_441file2sample, 0, __pyx_n_s_file2sample, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__468)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__469);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file2sample, __pyx_t_37) < 0) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__469 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__469);
  __Pyx_GIVEREF(__pyx_tuple__469);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_file2sample {
  int __pyx_n;
  PyObject *chan;
};
 3983:     """
 3984:     sample value \in sound file read by 'obj' \in channel chan at sample.
 3985:     
 3986:     :param gen: file2sample gen
 3987:     :param loc: location \in file to read
 3988:     :param chan: channel to read
 3989:     :rtype: float
 3990:     """
+3991:     return cclm.mus_file_to_sample(gen._ptr, loc, chan)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3991, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3991, __pyx_L1_error)
  __pyx_r = mus_file_to_sample(__pyx_v_gen->_ptr, __pyx_t_1, __pyx_t_2);
  goto __pyx_L0;
 3992: 
+3993: cpdef bint is_file2sample(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_443is_file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_file2sample(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_file2sample", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_443is_file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_442is_file2sample, "\n    returns True if gen is a file2sample.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_443is_file2sample = {"is_file2sample", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_443is_file2sample, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_442is_file2sample};
static PyObject *__pyx_pw_8pysndlib_3clm_443is_file2sample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_file2sample (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3993, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_file2sample") < 0)) __PYX_ERR(0, 3993, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_file2sample", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3993, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 3993, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_442is_file2sample(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_442is_file2sample(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_file2sample", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_file2sample(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3993, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_file2sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 3993, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_443is_file2sample, 0, __pyx_n_s_is_file2sample, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__470)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file2sample, __pyx_t_41) < 0) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__470 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_file2sample, 3993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__470)) __PYX_ERR(0, 3993, __pyx_L1_error)
 3994:     """
 3995:     returns True if gen is a file2sample.
 3996:     
 3997:     :param gen: gen
 3998:     :rtype: bool
 3999:     """
+4000:     return cclm.mus_is_file_to_sample(gen._ptr)
  __pyx_r = mus_is_file_to_sample(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4001: 
 4002: # ---------------- sample-to-file ---------------- #
+4003: cpdef mus_any make_sample2file(filename, chans: Optional[int]=1, sample_type: Optional[Sample]=None, header_type: Optional[Header]=None, comment: Optional[str]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_445make_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_sample2file(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_sample2file *__pyx_optional_args) {
  PyObject *__pyx_v_chans = ((PyObject *)__pyx_int_1);
  PyObject *__pyx_v_sample_type = ((PyObject *)Py_None);
  PyObject *__pyx_v_header_type = ((PyObject *)Py_None);
  PyObject *__pyx_v_comment = ((PyObject *)Py_None);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_sample2file", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_chans = __pyx_optional_args->chans;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_sample_type = __pyx_optional_args->sample_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_header_type = __pyx_optional_args->header_type;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_comment = __pyx_optional_args->comment;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_sample_type);
  __Pyx_INCREF(__pyx_v_header_type);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sample_type);
  __Pyx_XDECREF(__pyx_v_header_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_445make_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_444make_sample2file, "\n    return an output generator writing the sound file 'filename' which is set up to have chans'\n    channels of 'sample_type' samples with a header of 'header_type'.  the latter should be sndlib\n    identifiers.\n    \n    :param filename: name of file to write\n    :param chans: number of channels\n    :param sample_type: sample type of file\n    :param header_type: header type of file\n    :return: sample2file gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_445make_sample2file = {"make_sample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_445make_sample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_444make_sample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_445make_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_chans = 0;
  PyObject *__pyx_v_sample_type = 0;
  PyObject *__pyx_v_header_type = 0;
  PyObject *__pyx_v_comment = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_sample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_chans,&__pyx_n_s_sample_type,&__pyx_n_s_header_type,&__pyx_n_s_comment,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_1);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4003, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chans);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4003, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sample_type);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4003, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_type);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4003, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comment);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4003, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_sample2file") < 0)) __PYX_ERR(0, 4003, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_chans = values[1];
    __pyx_v_sample_type = values[2];
    __pyx_v_header_type = values[3];
    __pyx_v_comment = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_sample2file", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 4003, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_444make_sample2file(__pyx_self, __pyx_v_filename, __pyx_v_chans, __pyx_v_sample_type, __pyx_v_header_type, __pyx_v_comment);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_444make_sample2file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_chans, PyObject *__pyx_v_sample_type, PyObject *__pyx_v_header_type, PyObject *__pyx_v_comment) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_sample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.chans = __pyx_v_chans;
  __pyx_t_2.sample_type = __pyx_v_sample_type;
  __pyx_t_2.header_type = __pyx_v_header_type;
  __pyx_t_2.comment = __pyx_v_comment;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_sample2file(__pyx_v_filename, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__471 = PyTuple_Pack(5, __pyx_n_s_filename, __pyx_n_s_chans, __pyx_n_s_sample_type, __pyx_n_s_header_type, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(0, 4003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__471);
  __Pyx_GIVEREF(__pyx_tuple__471);
  __pyx_codeobj__472 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_sample2file, 4003, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__472)) __PYX_ERR(0, 4003, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_chans, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4003, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_sample_type, __pyx_kp_s_Optional_Sample) < 0) __PYX_ERR(0, 4003, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_header_type, __pyx_kp_s_Optional_Header) < 0) __PYX_ERR(0, 4003, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_comment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 4003, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_445make_sample2file, 0, __pyx_n_s_make_sample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__472)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__473);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_sample2file, __pyx_t_37) < 0) __PYX_ERR(0, 4003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__473 = PyTuple_Pack(4, __pyx_int_1, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(0, 4003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__473);
  __Pyx_GIVEREF(__pyx_tuple__473);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_sample2file {
  int __pyx_n;
  PyObject *chans;
  PyObject *sample_type;
  PyObject *header_type;
  PyObject *comment;
};
 4004:     """
 4005:     return an output generator writing the sound file 'filename' which is set up to have chans'
 4006:     channels of 'sample_type' samples with a header of 'header_type'.  the latter should be sndlib
 4007:     identifiers.
 4008:     
 4009:     :param filename: name of file to write
 4010:     :param chans: number of channels
 4011:     :param sample_type: sample type of file
 4012:     :param header_type: header type of file
 4013:     :return: sample2file gen
 4014:     :rtype: mus_any
 4015:     """
+4016:     sample_type = sample_type or CLM.sample_type
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sample_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4016, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_sample_type);
    __pyx_t_1 = __pyx_v_sample_type;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_sample_type, __pyx_t_1);
  __pyx_t_1 = 0;
+4017:     header_type = header_type or CLM.header_type
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_header_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4017, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_header_type);
    __pyx_t_1 = __pyx_v_header_type;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_header_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_header_type, __pyx_t_1);
  __pyx_t_1 = 0;
+4018:     if comment is None:
  __pyx_t_2 = (__pyx_v_comment == Py_None);
  if (__pyx_t_2) {
/* … */
  }
+4019:         return mus_any.from_ptr(cclm.mus_make_sample_to_file_with_comment(filename, chans, sample_type, header_type, NULL))
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyInt_As_mus_sample_t(__pyx_v_sample_type); if (unlikely((__pyx_t_7 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_mus_header_t(__pyx_v_header_type); if (unlikely((__pyx_t_8 == ((mus_header_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_sample_to_file_with_comment(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, NULL), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
 4020:     else:
+4021:         return mus_any.from_ptr(cclm.mus_make_sample_to_file_with_comment(filename, chans, sample_type, header_type, comment))
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyInt_As_mus_sample_t(__pyx_v_sample_type); if (unlikely((__pyx_t_7 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_mus_header_t(__pyx_v_header_type); if (unlikely((__pyx_t_8 == ((mus_header_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_comment); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_sample_to_file_with_comment(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
 4022: 
+4023: cpdef cython.double sample2file(gen: mus_any, samp: int, chan:int , val: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_447sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_sample2file(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_samp, PyObject *__pyx_v_chan, double __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sample2file", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_447sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_446sample2file, "\n    add val to the output stream handled by the output generator 'obj', \\in channel 'chan' at frample 'samp'.\n    \n    :param gen: sample2file gem\n    :param samp: location \\in file to write\n    :param chan: channel to write\n    :param val: sample value to write\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_447sample2file = {"sample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_447sample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_446sample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_447sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_samp = 0;
  PyObject *__pyx_v_chan = 0;
  double __pyx_v_val;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_samp,&__pyx_n_s_chan,&__pyx_n_s_val,0};
    PyObject* values[4] = {0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_samp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("sample2file", 1, 4, 4, 1); __PYX_ERR(0, 4023, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("sample2file", 1, 4, 4, 2); __PYX_ERR(0, 4023, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("sample2file", 1, 4, 4, 3); __PYX_ERR(0, 4023, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sample2file") < 0)) __PYX_ERR(0, 4023, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_samp = ((PyObject*)values[1]);
    __pyx_v_chan = ((PyObject*)values[2]);
    __pyx_v_val = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sample2file", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 4023, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4023, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samp), (&PyInt_Type), 0, "samp", 1))) __PYX_ERR(0, 4023, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chan), (&PyInt_Type), 0, "chan", 1))) __PYX_ERR(0, 4023, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_446sample2file(__pyx_self, __pyx_v_gen, __pyx_v_samp, __pyx_v_chan, __pyx_v_val);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_446sample2file(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_samp, PyObject *__pyx_v_chan, double __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_sample2file(__pyx_v_gen, __pyx_v_samp, __pyx_v_chan, __pyx_v_val, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__474 = PyTuple_Pack(4, __pyx_n_s_gen, __pyx_n_s_samp, __pyx_n_s_chan, __pyx_n_s_val); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(0, 4023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__474);
  __Pyx_GIVEREF(__pyx_tuple__474);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4023, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_samp, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4023, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_chan, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4023, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_val, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 4023, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_447sample2file, 0, __pyx_n_s_sample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__475)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sample2file, __pyx_t_41) < 0) __PYX_ERR(0, 4023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__475 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__474, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_sample2file, 4023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__475)) __PYX_ERR(0, 4023, __pyx_L1_error)
 4024:     """
 4025:     add val to the output stream handled by the output generator 'obj', \in channel 'chan' at frample 'samp'.
 4026:     
 4027:     :param gen: sample2file gem
 4028:     :param samp: location \in file to write
 4029:     :param chan: channel to write
 4030:     :param val: sample value to write
 4031:     :rtype: float
 4032:     """
+4033:     return cclm.mus_sample_to_file(gen._ptr, samp, chan, val)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_samp); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4033, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4033, __pyx_L1_error)
  __pyx_r = mus_sample_to_file(__pyx_v_gen->_ptr, __pyx_t_1, __pyx_t_2, __pyx_v_val);
  goto __pyx_L0;
 4034: 
+4035: cpdef bint is_sample2file(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_449is_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_sample2file(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sample2file", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_449is_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_448is_sample2file, "\n    returns True if gen is a sample2file.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_449is_sample2file = {"is_sample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_449is_sample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_448is_sample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_449is_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4035, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_sample2file") < 0)) __PYX_ERR(0, 4035, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_sample2file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4035, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4035, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_448is_sample2file(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_448is_sample2file(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_sample2file(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4035, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4035, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_449is_sample2file, 0, __pyx_n_s_is_sample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__476)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_sample2file, __pyx_t_37) < 0) __PYX_ERR(0, 4035, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__476 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_sample2file, 4035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__476)) __PYX_ERR(0, 4035, __pyx_L1_error)
 4036:     """
 4037:     returns True if gen is a sample2file.
 4038:     
 4039:     :param gen: gen
 4040:     :rtype: bool
 4041:     """
+4042:     return cclm.mus_is_sample_to_file(gen._ptr)
  __pyx_r = mus_is_sample_to_file(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4043: 
+4044: cpdef mus_any continue_sample2file(name: str):
static PyObject *__pyx_pw_8pysndlib_3clm_451continue_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_continue_sample2file(PyObject *__pyx_v_name, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continue_sample2file", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.continue_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_451continue_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_450continue_sample2file, "\n    reopen an existing file to continue adding sound data to it.\n    \n    :param filename: name of file to write\n    :return: file2sample gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_451continue_sample2file = {"continue_sample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_451continue_sample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_450continue_sample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_451continue_sample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continue_sample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "continue_sample2file") < 0)) __PYX_ERR(0, 4044, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("continue_sample2file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4044, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.continue_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 0, "name", 1))) __PYX_ERR(0, 4044, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_450continue_sample2file(__pyx_self, __pyx_v_name);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_450continue_sample2file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continue_sample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_continue_sample2file(__pyx_v_name, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.continue_sample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__477 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(0, 4044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__477);
  __Pyx_GIVEREF(__pyx_tuple__477);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_name, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 4044, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_451continue_sample2file, 0, __pyx_n_s_continue_sample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__478)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_continue_sample2file, __pyx_t_41) < 0) __PYX_ERR(0, 4044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_continue_sample2file, 4044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) __PYX_ERR(0, 4044, __pyx_L1_error)
 4045:     """
 4046:     reopen an existing file to continue adding sound data to it.
 4047:     
 4048:     :param filename: name of file to write
 4049:     :return: file2sample gen
 4050:     :rtype: mus_any
 4051:     """
+4052:     return mus_any.from_ptr(cclm.mus_continue_sample_to_file(name))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 4052, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_continue_sample_to_file(__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4053: 
 4054: 
 4055: # ---------------- file-to-frample ---------------- #
+4056: cpdef mus_any make_file2frample(filename, buffer_size: Optional[int]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_453make_file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_file2frample(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_file2frample *__pyx_optional_args) {
  PyObject *__pyx_v_buffer_size = ((PyObject *)Py_None);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_file2frample", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_buffer_size = __pyx_optional_args->buffer_size;
    }
  }
  __Pyx_INCREF(__pyx_v_buffer_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_453make_file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_452make_file2frample, "\n    return an input generator reading all channels of 'filename' (a sound file).\n    \n    :param filename: name of file to read\n    :param buffer_size: io buffer size\n    :return: file2frample gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_453make_file2frample = {"make_file2frample", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_453make_file2frample, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_452make_file2frample};
static PyObject *__pyx_pw_8pysndlib_3clm_453make_file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_buffer_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_file2frample (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_buffer_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4056, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer_size);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4056, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_file2frample") < 0)) __PYX_ERR(0, 4056, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_buffer_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_file2frample", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4056, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_452make_file2frample(__pyx_self, __pyx_v_filename, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_452make_file2frample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_file2frample", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.buffer_size = __pyx_v_buffer_size;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_file2frample(__pyx_v_filename, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_buffer_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4056, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_453make_file2frample, 0, __pyx_n_s_make_file2frample, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__479)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_file2frample, __pyx_t_37) < 0) __PYX_ERR(0, 4056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__479 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_file2frample, 4056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__479)) __PYX_ERR(0, 4056, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_file2frample {
  int __pyx_n;
  PyObject *buffer_size;
};
 4057:     """
 4058:     return an input generator reading all channels of 'filename' (a sound file).
 4059:     
 4060:     :param filename: name of file to read
 4061:     :param buffer_size: io buffer size
 4062:     :return: file2frample gen
 4063:     :rtype: mus_any
 4064:     """
+4065:     buffer_size = buffer_size or CLM.buffer_size
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4065, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_1 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_buffer_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_1);
  __pyx_t_1 = 0;
+4066:     return  mus_any.from_ptr(cclm.mus_make_file_to_frample_with_buffer_size(filename, buffer_size))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4066, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyInt_As_mus_long_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_6 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4066, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_file_to_frample_with_buffer_size(__pyx_t_5, __pyx_t_6), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4067: 
+4068: cpdef file2frample(gen: mus_any, loc: int):
static PyObject *__pyx_pw_8pysndlib_3clm_455file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_file2frample(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_loc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_outf = NULL;
  __Pyx_memviewslice __pyx_v_outf_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2frample", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_AddTraceback("pysndlib.clm.file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_outf);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_outf_view, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_455file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_454file2frample, "\n    frample of samples at frample 'samp' \\in sound file read by 'obj'.\n    \n    :param gen: file2frample gen\n    :param loc: location \\in file to read\n    :rtype: np.ndarray\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_455file2frample = {"file2frample", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_455file2frample, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_454file2frample};
static PyObject *__pyx_pw_8pysndlib_3clm_455file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_loc = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2frample (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_loc,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4068, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4068, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("file2frample", 1, 2, 2, 1); __PYX_ERR(0, 4068, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "file2frample") < 0)) __PYX_ERR(0, 4068, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_loc = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("file2frample", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4068, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4068, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4068, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_454file2frample(__pyx_self, __pyx_v_gen, __pyx_v_loc);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_454file2frample(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_loc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file2frample", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_file2frample(__pyx_v_gen, __pyx_v_loc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__480 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_loc); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__480);
  __Pyx_GIVEREF(__pyx_tuple__480);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4068, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4068, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_455file2frample, 0, __pyx_n_s_file2frample, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__481)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file2frample, __pyx_t_41) < 0) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__481 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__480, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_file2frample, 4068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__481)) __PYX_ERR(0, 4068, __pyx_L1_error)
 4069:     """
 4070:     frample of samples at frample 'samp' \in sound file read by 'obj'.
 4071:     
 4072:     :param gen: file2frample gen
 4073:     :param loc: location \in file to read
 4074:     :rtype: np.ndarray
 4075:     """
+4076:     outf = np.zeros(cclm.mus_channels(gen._ptr), dtype=np.double)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(mus_channels(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_outf = __pyx_t_5;
  __pyx_t_5 = 0;
+4077:     cdef double [:] outf_view = outf
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_outf, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 4077, __pyx_L1_error)
  __pyx_v_outf_view = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;
+4078:     cclm.mus_file_to_frample(gen._ptr, loc, &outf_view[0])
  __pyx_t_7 = __Pyx_PyInt_As_mus_long_t(__pyx_v_loc); if (unlikely((__pyx_t_7 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4078, __pyx_L1_error)
  __pyx_t_8 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_outf_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_outf_view.shape[0])) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    __PYX_ERR(0, 4078, __pyx_L1_error)
  }
  (void)(mus_file_to_frample(__pyx_v_gen->_ptr, __pyx_t_7, (&(*((double *) ( /* dim=0 */ (__pyx_v_outf_view.data + __pyx_t_8 * __pyx_v_outf_view.strides[0]) ))))));
+4079:     return outf
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_outf);
  __pyx_r = __pyx_v_outf;
  goto __pyx_L0;
 4080: 
+4081: cpdef is_file2frample(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_457is_file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_file2frample(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_file2frample", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_457is_file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_456is_file2frample, "\n    returns True if gen is a file2frample.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_457is_file2frample = {"is_file2frample", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_457is_file2frample, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_456is_file2frample};
static PyObject *__pyx_pw_8pysndlib_3clm_457is_file2frample(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_file2frample (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4081, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_file2frample") < 0)) __PYX_ERR(0, 4081, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_file2frample", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4081, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4081, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_456is_file2frample(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_456is_file2frample(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_file2frample", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_file2frample(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_file2frample", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4081, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_457is_file2frample, 0, __pyx_n_s_is_file2frample, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__482)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file2frample, __pyx_t_37) < 0) __PYX_ERR(0, 4081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_file2frample, 4081, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) __PYX_ERR(0, 4081, __pyx_L1_error)
 4082:     """
 4083:     returns True if gen is a file2frample.
 4084:     
 4085:     :param gen: gen
 4086:     :rtype: bool
 4087:     """
+4088:     return cclm.mus_is_file_to_frample(gen._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(mus_is_file_to_frample(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4089: 
 4090: 
 4091: # ---------------- frample-to-file ---------------- #
+4092: cpdef mus_any make_frample2file(filename, chans: Optional[int]=1, sample_type: Optional[sample]=None, header_type: Optional[header]=None, comment: Optional[str]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_459make_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_frample2file(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_frample2file *__pyx_optional_args) {
  PyObject *__pyx_v_chans = ((PyObject *)__pyx_int_1);
  PyObject *__pyx_v_sample_type = ((PyObject *)Py_None);
  PyObject *__pyx_v_header_type = ((PyObject *)Py_None);
  PyObject *__pyx_v_comment = ((PyObject *)Py_None);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_frample2file", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_chans = __pyx_optional_args->chans;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_sample_type = __pyx_optional_args->sample_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_header_type = __pyx_optional_args->header_type;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_comment = __pyx_optional_args->comment;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_sample_type);
  __Pyx_INCREF(__pyx_v_header_type);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sample_type);
  __Pyx_XDECREF(__pyx_v_header_type);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_459make_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_458make_frample2file, "\n    return an output generator writing the sound file 'filename' which is set up to have 'chans'\n    channels of 'sample_type' samples with a header of 'header_type'.  the latter should be sndlib\n    identifiers.    \n    \n    :param filename: name of file to write\n    :param chans: number of channels\n    :param frample2file: sample type of file\n    :param header_type: header type of file\n    :return: sample2file gen\n    :rtype: mus_any    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_459make_frample2file = {"make_frample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_459make_frample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_458make_frample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_459make_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_chans = 0;
  PyObject *__pyx_v_sample_type = 0;
  PyObject *__pyx_v_header_type = 0;
  PyObject *__pyx_v_comment = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_frample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_chans,&__pyx_n_s_sample_type,&__pyx_n_s_header_type,&__pyx_n_s_comment,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_1);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4092, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chans);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4092, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sample_type);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4092, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_type);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4092, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comment);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4092, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_frample2file") < 0)) __PYX_ERR(0, 4092, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = values[0];
    __pyx_v_chans = values[1];
    __pyx_v_sample_type = values[2];
    __pyx_v_header_type = values[3];
    __pyx_v_comment = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_frample2file", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 4092, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_458make_frample2file(__pyx_self, __pyx_v_filename, __pyx_v_chans, __pyx_v_sample_type, __pyx_v_header_type, __pyx_v_comment);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_458make_frample2file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_chans, PyObject *__pyx_v_sample_type, PyObject *__pyx_v_header_type, PyObject *__pyx_v_comment) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_frample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.chans = __pyx_v_chans;
  __pyx_t_2.sample_type = __pyx_v_sample_type;
  __pyx_t_2.header_type = __pyx_v_header_type;
  __pyx_t_2.comment = __pyx_v_comment;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_frample2file(__pyx_v_filename, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_chans, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4092, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_sample_type, __pyx_kp_s_Optional_sample) < 0) __PYX_ERR(0, 4092, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_header_type, __pyx_kp_s_Optional_header) < 0) __PYX_ERR(0, 4092, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_comment, __pyx_kp_s_Optional_str) < 0) __PYX_ERR(0, 4092, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_459make_frample2file, 0, __pyx_n_s_make_frample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__483)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__473);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_frample2file, __pyx_t_41) < 0) __PYX_ERR(0, 4092, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__483 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_frample2file, 4092, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__483)) __PYX_ERR(0, 4092, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_frample2file {
  int __pyx_n;
  PyObject *chans;
  PyObject *sample_type;
  PyObject *header_type;
  PyObject *comment;
};
 4093:     """
 4094:     return an output generator writing the sound file 'filename' which is set up to have 'chans'
 4095:     channels of 'sample_type' samples with a header of 'header_type'.  the latter should be sndlib
 4096:     identifiers.    
 4097:     
 4098:     :param filename: name of file to write
 4099:     :param chans: number of channels
 4100:     :param frample2file: sample type of file
 4101:     :param header_type: header type of file
 4102:     :return: sample2file gen
 4103:     :rtype: mus_any    
 4104:     """
+4105:     sample_type = sample_type or CLM.sample_type
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sample_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4105, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_sample_type);
    __pyx_t_1 = __pyx_v_sample_type;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_sample_type, __pyx_t_1);
  __pyx_t_1 = 0;
+4106:     header_type = header_type or CLM.header_type
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_header_type); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4106, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_header_type);
    __pyx_t_1 = __pyx_v_header_type;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_header_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_header_type, __pyx_t_1);
  __pyx_t_1 = 0;
+4107:     if comment:
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_comment); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4107, __pyx_L1_error)
  if (__pyx_t_2) {
/* … */
  }
+4108:         return mus_any.from_ptr(cclm.mus_make_frample_to_file_with_comment(filename, chans, sample_type, header_type, comment))
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4108, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4108, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyInt_As_mus_sample_t(__pyx_v_sample_type); if (unlikely((__pyx_t_7 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4108, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_mus_header_t(__pyx_v_header_type); if (unlikely((__pyx_t_8 == ((mus_header_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4108, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_comment); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 4108, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_frample_to_file_with_comment(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
 4109:     else:
+4110:         return mus_any.from_ptr(cclm.mus_make_frample_to_file_with_comment(filename, chans, sample_type, header_type, NULL))
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4110, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chans); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4110, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyInt_As_mus_sample_t(__pyx_v_sample_type); if (unlikely((__pyx_t_7 == ((mus_sample_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4110, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_mus_header_t(__pyx_v_header_type); if (unlikely((__pyx_t_8 == ((mus_header_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4110, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_frample_to_file_with_comment(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, NULL), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
 4111: 
+4112: cpdef cython.double frample2file(gen: mus_any, samp: int, vals):
static PyObject *__pyx_pw_8pysndlib_3clm_461frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_frample2file(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_samp, PyObject *__pyx_v_vals, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_val_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_frample = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frample2file", 0);
  __Pyx_INCREF(__pyx_v_vals);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_val_view, 1);
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_frample, 1);
  __Pyx_XDECREF(__pyx_v_vals);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_461frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_460frample2file, "\n    add frample 'val' to the output stream handled by the output generator 'obj' at frample 'samp'.\n    \n    :param gen: frample2file gem\n    :param samp: location \\in file to write\n    :param vals: sample value to write. list or np.ndarray\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_461frample2file = {"frample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_461frample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_460frample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_461frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_samp = 0;
  PyObject *__pyx_v_vals = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_samp,&__pyx_n_s_vals,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4112, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_samp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4112, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("frample2file", 1, 3, 3, 1); __PYX_ERR(0, 4112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vals)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4112, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("frample2file", 1, 3, 3, 2); __PYX_ERR(0, 4112, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frample2file") < 0)) __PYX_ERR(0, 4112, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_samp = ((PyObject*)values[1]);
    __pyx_v_vals = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("frample2file", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4112, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4112, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samp), (&PyInt_Type), 0, "samp", 1))) __PYX_ERR(0, 4112, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_460frample2file(__pyx_self, __pyx_v_gen, __pyx_v_samp, __pyx_v_vals);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_460frample2file(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_samp, PyObject *__pyx_v_vals) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_frample2file(__pyx_v_gen, __pyx_v_samp, __pyx_v_vals, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4112, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__484 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_samp, __pyx_n_s_vals); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__484);
  __Pyx_GIVEREF(__pyx_tuple__484);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4112, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_samp, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4112, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_461frample2file, 0, __pyx_n_s_frample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__485)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frample2file, __pyx_t_37) < 0) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__485 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__484, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_frample2file, 4112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__485)) __PYX_ERR(0, 4112, __pyx_L1_error)
 4113:     """
 4114:     add frample 'val' to the output stream handled by the output generator 'obj' at frample 'samp'.
 4115:     
 4116:     :param gen: frample2file gem
 4117:     :param samp: location \in file to write
 4118:     :param vals: sample value to write. list or np.ndarray
 4119:     :rtype: float
 4120:     """
+4121:     cdef double [:] val_view = None
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 4121, __pyx_L1_error)
  __pyx_v_val_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 4122: 
+4123:     if isinstance(vals, list):
  __pyx_t_2 = PyList_Check(__pyx_v_vals); 
  if (__pyx_t_2) {
/* … */
  }
+4124:         vals = np.array(vals)
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_vals};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_vals, __pyx_t_3);
    __pyx_t_3 = 0;
 4125: 
+4126:     val_view = vals
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_vals, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 4126, __pyx_L1_error)
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_val_view, 1);
  __pyx_v_val_view = __pyx_t_1;
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;
 4127: 
+4128:     frample = val_view
  __PYX_INC_MEMVIEW(&__pyx_v_val_view, 1);
  __pyx_v_frample = __pyx_v_val_view;
+4129:     cclm.mus_frample_to_file(gen._ptr, samp, &frample[0])
  __pyx_t_7 = __Pyx_PyInt_As_mus_long_t(__pyx_v_samp); if (unlikely((__pyx_t_7 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4129, __pyx_L1_error)
  __pyx_t_8 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_frample.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_frample.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(0, 4129, __pyx_L1_error)
  }
  (void)(mus_frample_to_file(__pyx_v_gen->_ptr, __pyx_t_7, (&(*((double *) ( /* dim=0 */ (__pyx_v_frample.data + __pyx_t_8 * __pyx_v_frample.strides[0]) ))))));
+4130:     return vals
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_vals); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4130, __pyx_L1_error)
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;
 4131: 
+4132: cpdef bint is_frample2file(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_463is_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_frample2file(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_frample2file", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_463is_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_462is_frample2file, "\n    returns True if gen is a frample2file.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_463is_frample2file = {"is_frample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_463is_frample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_462is_frample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_463is_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_frample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4132, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_frample2file") < 0)) __PYX_ERR(0, 4132, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_frample2file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4132, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_462is_frample2file(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_462is_frample2file(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_frample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_frample2file(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4132, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4132, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_463is_frample2file, 0, __pyx_n_s_is_frample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__486)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_frample2file, __pyx_t_41) < 0) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__486 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_frample2file, 4132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__486)) __PYX_ERR(0, 4132, __pyx_L1_error)
 4133:     """
 4134:     returns True if gen is a frample2file.
 4135:     
 4136:     :param gen: gen
 4137:     :rtype: bool
 4138:     """
+4139:     return cclm.mus_is_frample_to_file(gen._ptr)
  __pyx_r = mus_is_frample_to_file(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4140: 
 4141: 
+4142: cpdef mus_any continue_frample2file(name: str):
static PyObject *__pyx_pw_8pysndlib_3clm_465continue_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_continue_frample2file(PyObject *__pyx_v_name, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continue_frample2file", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.continue_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_465continue_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_464continue_frample2file, "\n    reopen an existing file to continue adding sound data to it.\n    \n    :param filename: name of file to write\n    :return: frample2file gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_465continue_frample2file = {"continue_frample2file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_465continue_frample2file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_464continue_frample2file};
static PyObject *__pyx_pw_8pysndlib_3clm_465continue_frample2file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continue_frample2file (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4142, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "continue_frample2file") < 0)) __PYX_ERR(0, 4142, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_name = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("continue_frample2file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4142, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.continue_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 0, "name", 1))) __PYX_ERR(0, 4142, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_464continue_frample2file(__pyx_self, __pyx_v_name);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_464continue_frample2file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("continue_frample2file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_continue_frample2file(__pyx_v_name, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.continue_frample2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_name, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 4142, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_465continue_frample2file, 0, __pyx_n_s_continue_frample2file, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__487)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_continue_frample2file, __pyx_t_37) < 0) __PYX_ERR(0, 4142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__487 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_continue_frample2file, 4142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__487)) __PYX_ERR(0, 4142, __pyx_L1_error)
 4143:     """
 4144:     reopen an existing file to continue adding sound data to it.
 4145:     
 4146:     :param filename: name of file to write
 4147:     :return: frample2file gen
 4148:     :rtype: mus_any
 4149:     """
+4150:     return mus_any.from_ptr(cclm.mus_continue_frample_to_file(name))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 4150, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_continue_frample_to_file(__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4151: 
 4152: 
 4153: # ---------------- readin ---------------- #
+4154: cpdef mus_any make_readin(filename: str, chan: int=0, start: int=0, direction: Optional[int]=1, buffer_size: Optional[int]=None):
static PyObject *__pyx_pw_8pysndlib_3clm_467make_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_readin(PyObject *__pyx_v_filename, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_readin *__pyx_optional_args) {
  PyObject *__pyx_v_chan = __pyx_k__45;
  PyObject *__pyx_v_start = __pyx_k__46;
  PyObject *__pyx_v_direction = ((PyObject *)__pyx_int_1);
  PyObject *__pyx_v_buffer_size = ((PyObject *)Py_None);
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_readin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_chan = __pyx_optional_args->chan;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_start = __pyx_optional_args->start;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_direction = __pyx_optional_args->direction;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_buffer_size = __pyx_optional_args->buffer_size;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_buffer_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_467make_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_466make_readin, "\n    return a new readin (file input) generator reading the sound file 'file' starting at frample\n    'start' \\in channel 'channel' and reading forward if 'direction' is not -1.\n    \n    :param filename: name of file to read\n    :param chan: channel to read (0 based)\n    :param start: location \\in samples to start at\n    :param direction: forward (1) or backward (-1)\n    :param buffer_size: io buffer size\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_467make_readin = {"make_readin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_467make_readin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_466make_readin};
static PyObject *__pyx_pw_8pysndlib_3clm_467make_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_chan = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_direction = 0;
  PyObject *__pyx_v_buffer_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_readin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_chan,&__pyx_n_s_start,&__pyx_n_s_direction,&__pyx_n_s_buffer_size,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = __pyx_k__45;
    values[2] = __pyx_k__46;
    values[3] = ((PyObject *)__pyx_int_1);
    values[4] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_direction);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer_size);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_readin") < 0)) __PYX_ERR(0, 4154, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filename = ((PyObject*)values[0]);
    __pyx_v_chan = ((PyObject*)values[1]);
    __pyx_v_start = ((PyObject*)values[2]);
    __pyx_v_direction = values[3];
    __pyx_v_buffer_size = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_readin", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 4154, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 0, "filename", 1))) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chan), (&PyInt_Type), 0, "chan", 1))) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_start), (&PyInt_Type), 0, "start", 1))) __PYX_ERR(0, 4154, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_466make_readin(__pyx_self, __pyx_v_filename, __pyx_v_chan, __pyx_v_start, __pyx_v_direction, __pyx_v_buffer_size);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_466make_readin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_chan, PyObject *__pyx_v_start, PyObject *__pyx_v_direction, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_readin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.chan = __pyx_v_chan;
  __pyx_t_2.start = __pyx_v_start;
  __pyx_t_2.direction = __pyx_v_direction;
  __pyx_t_2.buffer_size = __pyx_v_buffer_size;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_readin(__pyx_v_filename, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_0);
  __pyx_k__45 = ((PyObject*)__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_0);
  __pyx_k__46 = ((PyObject*)__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
/* … */
  __pyx_tuple__488 = PyTuple_Pack(5, __pyx_n_s_filename, __pyx_n_s_chan, __pyx_n_s_start, __pyx_n_s_direction, __pyx_n_s_buffer_size); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__488);
  __Pyx_GIVEREF(__pyx_tuple__488);
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 4154, __pyx_L1_error)
  __pyx_t_37 = PyTuple_New(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_37, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_37, 2, __pyx_int_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_37, 3, Py_None);
  __pyx_t_41 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_filename, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_chan, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_start, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_direction, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_buffer_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4154, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_467make_readin, 0, __pyx_n_s_make_readin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__489)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_readin, __pyx_t_40) < 0) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__489 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__488, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_readin, 4154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__489)) __PYX_ERR(0, 4154, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_readin {
  int __pyx_n;
  PyObject *chan;
  PyObject *start;
  PyObject *direction;
  PyObject *buffer_size;
};
 4155:     """
 4156:     return a new readin (file input) generator reading the sound file 'file' starting at frample
 4157:     'start' \in channel 'channel' and reading forward if 'direction' is not -1.
 4158:     
 4159:     :param filename: name of file to read
 4160:     :param chan: channel to read (0 based)
 4161:     :param start: location \in samples to start at
 4162:     :param direction: forward (1) or backward (-1)
 4163:     :param buffer_size: io buffer size
 4164:     
 4165:     """
+4166:     check_range('chan', chan, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_chan, __pyx_v_chan, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4167:     check_range('start', start, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_start, __pyx_v_start, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4168:     check_range('buffer_size', buffer_size, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_buffer_size, __pyx_v_buffer_size, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4169: 
+4170:     buffer_size = buffer_size or CLM.buffer_size
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 4170, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_1 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_1);
  __pyx_t_1 = 0;
+4171:     return mus_any.from_ptr(cclm.mus_make_readin_with_buffer_size(filename, chan, start, direction, buffer_size))
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyInt_As_mus_long_t(__pyx_v_start); if (unlikely((__pyx_t_7 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_direction); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_mus_long_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_9 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_readin_with_buffer_size(__pyx_t_6, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_9), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4172: 
+4173: cpdef cython.double readin(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_469readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_readin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readin", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_469readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_468readin, "\n    next sample from readin generator (a sound file reader).\n    \n    :param gen: readin gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_469readin = {"readin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_469readin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_468readin};
static PyObject *__pyx_pw_8pysndlib_3clm_469readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4173, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "readin") < 0)) __PYX_ERR(0, 4173, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4173, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4173, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_468readin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_468readin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_readin(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4173, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4173, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_469readin, 0, __pyx_n_s_readin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__490)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_readin, __pyx_t_41) < 0) __PYX_ERR(0, 4173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__490 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_readin, 4173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__490)) __PYX_ERR(0, 4173, __pyx_L1_error)
 4174:     """
 4175:     next sample from readin generator (a sound file reader).
 4176:     
 4177:     :param gen: readin gen
 4178:     :rtype: float
 4179:     """
+4180:     return cclm.mus_readin(gen._ptr)
  __pyx_r = mus_readin(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4181: 
+4182: cpdef is_readin(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_471is_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_readin(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_readin", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_471is_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_470is_readin, "\n    returns True if gen is a readin.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_471is_readin = {"is_readin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_471is_readin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_470is_readin};
static PyObject *__pyx_pw_8pysndlib_3clm_471is_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_readin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4182, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_readin") < 0)) __PYX_ERR(0, 4182, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_readin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4182, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4182, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_470is_readin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_470is_readin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_readin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_readin(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4182, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_471is_readin, 0, __pyx_n_s_is_readin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__491)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_readin, __pyx_t_40) < 0) __PYX_ERR(0, 4182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__491 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_readin, 4182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__491)) __PYX_ERR(0, 4182, __pyx_L1_error)
 4183:     """
 4184:     returns True if gen is a readin.
 4185:     
 4186:     :param gen: gen
 4187:     :rtype: bool
 4188:     """
+4189:     return cclm.mus_is_readin(gen._ptr)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(mus_is_readin(__pyx_v_gen->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4190: 
 4191: 
 4192: # ---------------- src ---------------- #
+4193: def make_src(inp , srate: Optional[float]=1.0, width: Optional[int]=10):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_473make_src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_472make_src, "\n    return a new sampling-rate conversion generator (using 'warped sinc interpolation'). 'srate' is the\n    ratio between the new rate and the old. 'width' is the sine width (effectively the steepness of the\n    low-pass filter), normally between 10 and 100. 'input' if given is an open file stream.\n    \n    :param inp: gen or function to read from. if a callback, the function takes 1 input, the direction and should return read value\n    :param srate: ratio between the old sampling rate and the new\n    :param width: how many samples to convolve with sinc function\n    :return: src gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_473make_src = {"make_src", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_473make_src, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_472make_src};
static PyObject *__pyx_pw_8pysndlib_3clm_473make_src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_inp = 0;
  PyObject *__pyx_v_srate = 0;
  PyObject *__pyx_v_width = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_src (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inp,&__pyx_n_s_srate,&__pyx_n_s_width,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_float_1_0));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_10));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_srate);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4193, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_src") < 0)) __PYX_ERR(0, 4193, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_inp = values[0];
    __pyx_v_srate = values[1];
    __pyx_v_width = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_src", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 4193, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_472make_src(__pyx_self, __pyx_v_inp, __pyx_v_srate, __pyx_v_width);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_472make_src(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_inp, PyObject *__pyx_v_srate, PyObject *__pyx_v_width) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src *__pyx_cur_scope;
  input_cb __pyx_v_cy_inp_f_ptr;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_res = NULL;
  PyObject *__pyx_v_inp_f = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_src", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct_1_make_src(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct_1_make_src, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 4193, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_inp = __pyx_v_inp;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inp);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.make_src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_inp_f);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__492 = PyTuple_Pack(7, __pyx_n_s_inp, __pyx_n_s_srate, __pyx_n_s_width, __pyx_n_s_cy_inp_f_ptr, __pyx_n_s_res, __pyx_n_s_inp_f, __pyx_n_s_inp_f); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(0, 4193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__492);
  __Pyx_GIVEREF(__pyx_tuple__492);
  __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_src, 4193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) __PYX_ERR(0, 4193, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_srate, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4193, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_width, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4193, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_473make_src, 0, __pyx_n_s_make_src, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__493)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__494);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_src, __pyx_t_41) < 0) __PYX_ERR(0, 4193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__494 = PyTuple_Pack(2, ((PyObject*)__pyx_float_1_0), ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(0, 4193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__494);
  __Pyx_GIVEREF(__pyx_tuple__494);
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src {
  PyObject_HEAD
  PyObject *__pyx_v_inp;
};

 4194:     """
 4195:     return a new sampling-rate conversion generator (using 'warped sinc interpolation'). 'srate' is the
 4196:     ratio between the new rate and the old. 'width' is the sine width (effectively the steepness of the
 4197:     low-pass filter), normally between 10 and 100. 'input' if given is an open file stream.
 4198:     
 4199:     :param inp: gen or function to read from. if a callback, the function takes 1 input, the direction and should return read value
 4200:     :param srate: ratio between the old sampling rate and the new
 4201:     :param width: how many samples to convolve with sinc function
 4202:     :return: src gen
 4203:     :rtype: mus_any
 4204:     """
 4205: 
+4206:     check_range('srate', srate, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_srate, __pyx_v_srate, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4207:     check_range('width', width, 0, None)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_n_s_width, __pyx_v_width, __pyx_int_0, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4208: 
 4209:     cdef cclm.input_cb cy_inp_f_ptr
 4210: 
+4211:     if(isinstance(inp, mus_any)):
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_t_1, __pyx_ptype_8pysndlib_3clm_mus_any); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
/* … */
  }
+4212:         res = mus_any.from_ptr(cclm.mus_make_src(<cclm.input_cb>input_callback_func, srate, width, <void*>((<mus_any>inp)._ptr)))
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_srate); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4212, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4212, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_src(((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func), __pyx_t_6, __pyx_t_4, ((void *)((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_inp)->_ptr)), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
+4213:         res._inputcallback = <cclm.input_cb>input_callback_func
    __pyx_v_res->_inputcallback = ((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func);
+4214:         return res
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = ((PyObject *)__pyx_v_res);
    goto __pyx_L0;
 4215: 
+4216:     if not callable(inp):
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 4216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (!__pyx_t_5);
  if (unlikely(__pyx_t_7)) {
/* … */
  }
+4217:         raise TypeError(f"input needs to be a clm gen or function not a {type(inp)}")
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_inp)), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_input_needs_to_be_a_clm_gen_or_f, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 4217, __pyx_L1_error)
 4218: 
+4219:     @INPUTCALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_8make_src_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_8make_src_1inp_f = {"inp_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_8make_src_1inp_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_8make_src_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  PyObject *__pyx_v_d = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_d,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4219, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4219, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, 1); __PYX_ERR(0, 4219, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "inp_f") < 0)) __PYX_ERR(0, 4219, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = values[0];
    __pyx_v_d = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4219, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_src.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_8make_src_inp_f(__pyx_self, __pyx_v_gen, __pyx_v_d);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_8make_src_inp_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen, PyObject *__pyx_v_d) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_1_make_src *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_src.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_INPUTCALLBACK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
/* … */
  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_d); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 4219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_8make_src_1inp_f, 0, __pyx_n_s_make_src_locals_inp_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_inp_f = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_inp_f, 4219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 4219, __pyx_L1_error)
 4220:     def inp_f(gen, d):
+4221:         return inp(d)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_inp)) { __Pyx_RaiseClosureNameError("inp"); __PYX_ERR(0, 4221, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_inp; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4222: 
+4223:     cy_inp_f_ptr = (<cclm.input_cb*><size_t>ctypes.addressof(inp_f))[0]
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_addressof); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_inp_f};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cy_inp_f_ptr = (((input_cb *)((size_t)__pyx_t_9))[0]);
+4224:     res = mus_any.from_ptr(cclm.mus_make_src(cy_inp_f_ptr, srate, width, NULL))
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_srate); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_src(__pyx_v_cy_inp_f_ptr, __pyx_t_6, __pyx_t_4, NULL), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
  __pyx_t_1 = 0;
+4225:     res._inputcallback = cy_inp_f_ptr
  __pyx_v_res->_inputcallback = __pyx_v_cy_inp_f_ptr;
+4226:     res.cache_append(inp_f)
  __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_res->__pyx_vtab)->cache_append(__pyx_v_res, __pyx_v_inp_f, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4227: 
+4228:     return res
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;
 4229: 
+4230: cpdef cython.double src(gen: mus_any, sr_change: Optional[float]=0.0):
static PyObject *__pyx_pw_8pysndlib_3clm_475src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_src(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_src *__pyx_optional_args) {
  PyObject *__pyx_v_sr_change = ((PyObject *)__pyx_float_0_0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("src", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sr_change = __pyx_optional_args->sr_change;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_475src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_474src, "\n    next sampling rate conversion sample. 'pm' can be used to change the sampling rate on a\n    sample-by-sample basis. 'input-function' is a function of one argument (the current input direction,\n    normally ignored) that is called internally whenever a new sample of input data is needed.  if the\n    associated make_src included an 'input' argument, input-function is ignored.\n    \n    :param gen: src gen\n    :param sr_change: change \\in ratio\n    :rtype: float  \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_475src = {"src", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_475src, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_474src};
static PyObject *__pyx_pw_8pysndlib_3clm_475src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_sr_change = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("src (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_sr_change,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_float_0_0);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4230, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sr_change);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4230, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "src") < 0)) __PYX_ERR(0, 4230, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_sr_change = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("src", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4230, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4230, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_474src(__pyx_self, __pyx_v_gen, __pyx_v_sr_change);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_474src(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_sr_change) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("src", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.sr_change = __pyx_v_sr_change;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_src(__pyx_v_gen, 0, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4230, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__495 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_sr_change); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(0, 4230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__495);
  __Pyx_GIVEREF(__pyx_tuple__495);
  __pyx_codeobj__496 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__495, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_src, 4230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__496)) __PYX_ERR(0, 4230, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4230, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_sr_change, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4230, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_475src, 0, __pyx_n_s_src, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__496)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__497);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_src, __pyx_t_40) < 0) __PYX_ERR(0, 4230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__497 = PyTuple_Pack(1, __pyx_float_0_0); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(0, 4230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__497);
  __Pyx_GIVEREF(__pyx_tuple__497);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_src {
  int __pyx_n;
  PyObject *sr_change;
};
 4231:     """
 4232:     next sampling rate conversion sample. 'pm' can be used to change the sampling rate on a
 4233:     sample-by-sample basis. 'input-function' is a function of one argument (the current input direction,
 4234:     normally ignored) that is called internally whenever a new sample of input data is needed.  if the
 4235:     associated make_src included an 'input' argument, input-function is ignored.
 4236:     
 4237:     :param gen: src gen
 4238:     :param sr_change: change \in ratio
 4239:     :rtype: float  
 4240:     """
+4241:     if gen._inputcallback:
  __pyx_t_1 = (__pyx_v_gen->_inputcallback != 0);
  if (__pyx_t_1) {
/* … */
  }
+4242:         return cclm.mus_src(gen._ptr, sr_change, <cclm.input_cb>gen._inputcallback)
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_sr_change); if (unlikely((__pyx_t_2 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4242, __pyx_L1_error)
    __pyx_r = mus_src(__pyx_v_gen->_ptr, __pyx_t_2, ((input_cb)__pyx_v_gen->_inputcallback));
    goto __pyx_L0;
 4243:     else:
+4244:         return 0.0
  /*else*/ {
    __pyx_r = 0.0;
    goto __pyx_L0;
  }
 4245: 
+4246: cpdef bint is_src(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_477is_src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_src(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_src", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_477is_src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_476is_src, "\n    returns True if gen is a src.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_477is_src = {"is_src", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_477is_src, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_476is_src};
static PyObject *__pyx_pw_8pysndlib_3clm_477is_src(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_src (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4246, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_src") < 0)) __PYX_ERR(0, 4246, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_src", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4246, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4246, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_476is_src(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_476is_src(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_src", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_src(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4246, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_src", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4246, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_477is_src, 0, __pyx_n_s_is_src, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__498)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_src, __pyx_t_41) < 0) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__498 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_src, 4246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__498)) __PYX_ERR(0, 4246, __pyx_L1_error)
 4247:     """
 4248:     returns True if gen is a src.
 4249:     
 4250:     :param gen: gen
 4251:     :rtype: bool
 4252:     """
+4253:     return cclm.mus_is_src(gen._ptr)
  __pyx_r = mus_is_src(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4254: 
 4255: 
 4256: # ---------------- convolve ---------------- #
 4257: 
+4258: def make_convolve(inp, filt, fft_size: Optional[int]=512, filter_size: Optional[int]=None ):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_479make_convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_478make_convolve, "\n    return a new convolution generator which convolves its input with the impulse response 'filter'.\n    \n    :param inp: gen or function to read from\n    :param filt: np.array of filter \n    :param fft_size: fft size used \\in the convolution\n    :param filter_size: how much of filter to use. if None use whole filter\n    :return: convolve gen\n    :rtype: mus_any\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_479make_convolve = {"make_convolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_479make_convolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_478make_convolve};
static PyObject *__pyx_pw_8pysndlib_3clm_479make_convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_inp = 0;
  PyObject *__pyx_v_filt = 0;
  PyObject *__pyx_v_fft_size = 0;
  PyObject *__pyx_v_filter_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_convolve (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inp,&__pyx_n_s_filt,&__pyx_n_s_fft_size,&__pyx_n_s_filter_size,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)__pyx_int_512));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4258, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filt)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4258, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_convolve", 0, 2, 4, 1); __PYX_ERR(0, 4258, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fft_size);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4258, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filter_size);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4258, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_convolve") < 0)) __PYX_ERR(0, 4258, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_inp = values[0];
    __pyx_v_filt = values[1];
    __pyx_v_fft_size = values[2];
    __pyx_v_filter_size = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_convolve", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 4258, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_convolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_478make_convolve(__pyx_self, __pyx_v_inp, __pyx_v_filt, __pyx_v_fft_size, __pyx_v_filter_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_478make_convolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_inp, PyObject *__pyx_v_filt, PyObject *__pyx_v_fft_size, PyObject *__pyx_v_filter_size) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve *__pyx_cur_scope;
  input_cb __pyx_v_cy_input_f_ptr;
  __Pyx_memviewslice __pyx_v_filt_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_fft_len = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_res = NULL;
  PyObject *__pyx_v_inp_f = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_convolve", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct_2_make_convolve(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct_2_make_convolve, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 4258, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_inp = __pyx_v_inp;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inp);
  __Pyx_INCREF(__pyx_v_filt);
  __Pyx_INCREF(__pyx_v_fft_size);
  __Pyx_INCREF(__pyx_v_filter_size);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pysndlib.clm.make_convolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_filt_view, 1);
  __Pyx_XDECREF(__pyx_v_fft_len);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_inp_f);
  __Pyx_XDECREF(__pyx_v_filt);
  __Pyx_XDECREF(__pyx_v_fft_size);
  __Pyx_XDECREF(__pyx_v_filter_size);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__499 = PyTuple_Pack(10, __pyx_n_s_inp, __pyx_n_s_filt, __pyx_n_s_fft_size, __pyx_n_s_filter_size, __pyx_n_s_cy_input_f_ptr, __pyx_n_s_filt_view, __pyx_n_s_fft_len, __pyx_n_s_res, __pyx_n_s_inp_f, __pyx_n_s_inp_f); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(0, 4258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__499);
  __Pyx_GIVEREF(__pyx_tuple__499);
  __pyx_codeobj__500 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__499, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_convolve, 4258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__500)) __PYX_ERR(0, 4258, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fft_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4258, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_filter_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4258, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_479make_convolve, 0, __pyx_n_s_make_convolve, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__500)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__501);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_convolve, __pyx_t_40) < 0) __PYX_ERR(0, 4258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__501 = PyTuple_Pack(2, ((PyObject *)__pyx_int_512), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(0, 4258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__501);
  __Pyx_GIVEREF(__pyx_tuple__501);
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve {
  PyObject_HEAD
  PyObject *__pyx_v_inp;
};

 4259:     """
 4260:     return a new convolution generator which convolves its input with the impulse response 'filter'.
 4261:     
 4262:     :param inp: gen or function to read from
 4263:     :param filt: np.array of filter 
 4264:     :param fft_size: fft size used \in the convolution
 4265:     :param filter_size: how much of filter to use. if None use whole filter
 4266:     :return: convolve gen
 4267:     :rtype: mus_any
 4268:     """
 4269: 
 4270:     cdef cclm.input_cb cy_input_f_ptr
 4271: 
 4272:     cdef double [:] filt_view
 4273: 
 4274: 
+4275:     if filter_size is None:
  __pyx_t_1 = (__pyx_v_filter_size == Py_None);
  if (__pyx_t_1) {
/* … */
  }
+4276:         filter_size = clm_length(filt)
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_clm_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filt};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_filter_size, __pyx_t_2);
    __pyx_t_2 = 0;
 4277: 
+4278:     fft_len = 0
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_fft_len = __pyx_int_0;
 4279: 
+4280:     if fft_size < 0 or fft_size == 0:
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_fft_size, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4280, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 4280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_fft_size, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 4280, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+4281:         raise ValueError(f'fft_size must be a positive number greater than 0 not {fft_size}')
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_fft_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_fft_size_must_be_a_positive_numb, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 4281, __pyx_L1_error)
 4282: 
+4283:     if fft_size > csndlib.mus_max_malloc():
  __pyx_t_2 = __Pyx_PyInt_From_mus_long_t(mus_max_malloc()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fft_size, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 4283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+4284:          raise ValueError(f'fft_size too large. cannot allocate {fft_size} size fft')
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_fft_size_too_large_cannot_alloca);
    __pyx_t_7 += 36;
    __Pyx_GIVEREF(__pyx_kp_u_fft_size_too_large_cannot_alloca);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_fft_size_too_large_cannot_alloca);
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_fft_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u_size_fft);
    __pyx_t_7 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_size_fft);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_size_fft);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4284, __pyx_L1_error)
 4285: 
+4286:     if is_power_of_2(filter_size):
  __pyx_t_3 = __pyx_f_8pysndlib_3clm_is_power_of_2(__pyx_v_filter_size, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 4286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {
/* … */
    goto __pyx_L8;
  }
+4287:         fft_len = filter_size * 2
    __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_filter_size, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_fft_len, __pyx_t_3);
    __pyx_t_3 = 0;
 4288:     else :
+4289:         fft_len = next_power_of_2(filter_size)
  /*else*/ {
    __pyx_t_3 = __pyx_f_8pysndlib_3clm_next_power_of_2(__pyx_v_filter_size, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_fft_len, __pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L8:;
 4290: 
+4291:     if fft_size < fft_len:
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fft_size, __pyx_v_fft_len, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4291, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 4291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {
/* … */
  }
+4292:         fft_size = fft_len
    __Pyx_INCREF(__pyx_v_fft_len);
    __Pyx_DECREF_SET(__pyx_v_fft_size, __pyx_v_fft_len);
 4293: 
+4294:     if isinstance(filt, list):
  __pyx_t_1 = PyList_Check(__pyx_v_filt); 
  if (__pyx_t_1) {
/* … */
  }
+4295:         filt = np.array(filt)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_filt};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_filt, __pyx_t_3);
    __pyx_t_3 = 0;
 4296: 
+4297:     check_ndim(filt)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_filt};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 4298: 
+4299:     filt_view = filt
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_filt, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 4299, __pyx_L1_error)
  __pyx_v_filt_view = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;
 4300: 
+4301:     if(isinstance(inp, mus_any)):
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_3, __pyx_ptype_8pysndlib_3clm_mus_any); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {
/* … */
  }
+4302:         res = mus_any.from_ptr(cclm.mus_make_convolve(<cclm.input_cb>input_callback_func, &filt_view[0], fft_size, filter_size, <void*>(<mus_any>inp)._ptr))
    __pyx_t_10 = 0;
    __pyx_t_5 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_v_filt_view.shape[0];
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_v_filt_view.shape[0])) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      __PYX_ERR(0, 4302, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_PyInt_As_mus_long_t(__pyx_v_fft_size); if (unlikely((__pyx_t_11 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4302, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyInt_As_mus_long_t(__pyx_v_filter_size); if (unlikely((__pyx_t_12 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4302, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_convolve(((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func), (&(*((double *) ( /* dim=0 */ (__pyx_v_filt_view.data + __pyx_t_10 * __pyx_v_filt_view.strides[0]) )))), __pyx_t_11, __pyx_t_12, ((void *)((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_inp)->_ptr)), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
    __pyx_t_3 = 0;
+4303:         res._inputcallback = <cclm.input_cb>input_callback_func
    __pyx_v_res->_inputcallback = ((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func);
+4304:         res.cache_append(filt)
    __pyx_t_3 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_res->__pyx_vtab)->cache_append(__pyx_v_res, __pyx_v_filt, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+4305:         return res
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = ((PyObject *)__pyx_v_res);
    goto __pyx_L0;
 4306: 
+4307:     if not callable(inp):
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (!__pyx_t_1);
  if (unlikely(__pyx_t_6)) {
/* … */
  }
+4308:         raise TypeError(f"input needs to be a clm gen or function not a {type(inp)}")
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_inp)), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_input_needs_to_be_a_clm_gen_or_f, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4308, __pyx_L1_error)
 4309: 
+4310:     @INPUTCALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_13make_convolve_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_13make_convolve_1inp_f = {"inp_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_13make_convolve_1inp_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_13make_convolve_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  PyObject *__pyx_v_d = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_d,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4310, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, 1); __PYX_ERR(0, 4310, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "inp_f") < 0)) __PYX_ERR(0, 4310, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = values[0];
    __pyx_v_d = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4310, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_convolve.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_13make_convolve_inp_f(__pyx_self, __pyx_v_gen, __pyx_v_d);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_13make_convolve_inp_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen, PyObject *__pyx_v_d) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_2_make_convolve *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_convolve.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_INPUTCALLBACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_13make_convolve_1inp_f, 0, __pyx_n_s_make_convolve_locals_inp_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_inp_f = __pyx_t_3;
  __pyx_t_3 = 0;
/* … */
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_inp_f, 4310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 4310, __pyx_L1_error)
 4311:     def inp_f(gen, d):
+4312:         return inp(d)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_inp)) { __Pyx_RaiseClosureNameError("inp"); __PYX_ERR(0, 4312, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_inp; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4313: 
+4314:     inp_f = INPUTCALLBACK(inp)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_INPUTCALLBACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_inp};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_inp_f, __pyx_t_3);
  __pyx_t_3 = 0;
+4315:     cy_input_f_ptr = (<cclm.input_cb*><size_t>ctypes.addressof(inp_f))[0]
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_addressof); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_inp_f};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_cy_input_f_ptr = (((input_cb *)((size_t)__pyx_t_14))[0]);
+4316:     res = mus_any.from_ptr(cclm.mus_make_convolve(cy_input_f_ptr, &filt_view[0], fft_size, filter_size, NULL))
  __pyx_t_10 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_v_filt_view.shape[0];
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_v_filt_view.shape[0])) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    __PYX_ERR(0, 4316, __pyx_L1_error)
  }
  __pyx_t_12 = __Pyx_PyInt_As_mus_long_t(__pyx_v_fft_size); if (unlikely((__pyx_t_12 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L1_error)
  __pyx_t_11 = __Pyx_PyInt_As_mus_long_t(__pyx_v_filter_size); if (unlikely((__pyx_t_11 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_convolve(__pyx_v_cy_input_f_ptr, (&(*((double *) ( /* dim=0 */ (__pyx_v_filt_view.data + __pyx_t_10 * __pyx_v_filt_view.strides[0]) )))), __pyx_t_12, __pyx_t_11, NULL), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
  __pyx_t_3 = 0;
+4317:     res._inputcallback = cy_input_f_ptr
  __pyx_v_res->_inputcallback = __pyx_v_cy_input_f_ptr;
+4318:     res.cache_append(inp_f)
  __pyx_t_3 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_v_res->__pyx_vtab)->cache_append(__pyx_v_res, __pyx_v_inp_f, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 4319: 
+4320:     return res
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_v_res);
  goto __pyx_L0;
 4321: 
 4322: 
+4323: cpdef cython.double convolve(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_481convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_convolve(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolve", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_481convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_480convolve, "\n    next sample from convolution generator.\n    \n    :param gen: convolve gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_481convolve = {"convolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_481convolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_480convolve};
static PyObject *__pyx_pw_8pysndlib_3clm_481convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolve (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4323, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convolve") < 0)) __PYX_ERR(0, 4323, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convolve", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4323, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.convolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4323, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_480convolve(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_480convolve(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_convolve(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4323, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.convolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4323, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_481convolve, 0, __pyx_n_s_convolve, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__502)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve, __pyx_t_41) < 0) __PYX_ERR(0, 4323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__502 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_convolve, 4323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__502)) __PYX_ERR(0, 4323, __pyx_L1_error)
 4324:     """
 4325:     next sample from convolution generator.
 4326:     
 4327:     :param gen: convolve gen
 4328:     :rtype: float
 4329:     """
+4330:     return cclm.mus_convolve(gen._ptr, gen._inputcallback)
  __pyx_r = mus_convolve(__pyx_v_gen->_ptr, __pyx_v_gen->_inputcallback);
  goto __pyx_L0;
 4331: 
+4332: cpdef bint is_convolve(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_483is_convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_convolve(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_convolve", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_483is_convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_482is_convolve, "\n    returns True if gen is a convolve.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_483is_convolve = {"is_convolve", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_483is_convolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_482is_convolve};
static PyObject *__pyx_pw_8pysndlib_3clm_483is_convolve(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_convolve (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_convolve") < 0)) __PYX_ERR(0, 4332, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_convolve", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4332, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_convolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4332, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_482is_convolve(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_482is_convolve(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_convolve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_convolve(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4332, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_convolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4332, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_483is_convolve, 0, __pyx_n_s_is_convolve, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__503)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_convolve, __pyx_t_40) < 0) __PYX_ERR(0, 4332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_convolve, 4332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) __PYX_ERR(0, 4332, __pyx_L1_error)
 4333:     """
 4334:     returns True if gen is a convolve.
 4335:     
 4336:     :param gen: gen
 4337:     :rtype: bool
 4338:     """
+4339:     return cclm.mus_is_convolve(gen._ptr)
  __pyx_r = mus_is_convolve(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4340: 
 4341: 
 4342: # --------------- granulate ---------------- 
+4343: def make_granulate(inp,
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_485make_granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_484make_granulate, "\n    return a new granular synthesis generator.  'length' is the grain length (seconds), 'expansion' is the\n    ratio \\in timing between the new and old (expansion > 1.0 slows things down), 'scaler' scales the grains\n    to avoid overflows, 'hop' is the spacing (seconds) between successive grains upon output. 'jitter'\n    controls the randomness \\in that spacing, 'input' can be a file pointer. 'edit' can be a function of one\n    arg, the current granulate generator.  it is called just before a grain is added into the output\n    buffer. the current grain is accessible via mus_data. the edit function, if any, should return the\n    length \\in samples of the grain, or 0.\n    \n    :param inp: gen or function to read from. if a callback, the function takes 1 input, the direction and should return read value\n    :param expansion: how much to lengthen or compress the file\n    :param length: length of file slices that are overlapped\n    :param scaler: amplitude scaler on slices (to avoid overflows)\n    :param hop: speed at which slices are repeated \\in output\n    :param ramp: amount of slice-time spent ramping up/down\n    :param jitter: affects spacing of successive grains\n    :param max_size: internal buffer size\n    :param edit: grain editing function. the function should take one argument, the granulate mus_any and return length of grain or 0\n\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_485make_granulate = {"make_granulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_485make_granulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_484make_granulate};
static PyObject *__pyx_pw_8pysndlib_3clm_485make_granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_inp = 0;
  PyObject *__pyx_v_expansion = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_scaler = 0;
  PyObject *__pyx_v_hop = 0;
  PyObject *__pyx_v_ramp = 0;
  PyObject *__pyx_v_jitter = 0;
  PyObject *__pyx_v_max_size = 0;
  PyObject *__pyx_v_edit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_granulate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inp,&__pyx_n_s_expansion,&__pyx_n_s_length,&__pyx_n_s_scaler,&__pyx_n_s_hop,&__pyx_n_s_ramp,&__pyx_n_s_jitter,&__pyx_n_s_max_size,&__pyx_n_s_edit,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_float_1_0));
    values[2] = ((PyObject *)((PyObject*)__pyx_float__15));
    values[3] = ((PyObject *)((PyObject*)__pyx_float__6));
    values[4] = ((PyObject *)((PyObject*)__pyx_float__05));
    values[5] = ((PyObject *)((PyObject*)__pyx_float__4));
    values[6] = ((PyObject *)((PyObject*)__pyx_float_0_0));
    values[7] = ((PyObject *)((PyObject *)__pyx_int_0));
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_484make_granulate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_inp, PyObject *__pyx_v_expansion, PyObject *__pyx_v_length, PyObject *__pyx_v_scaler, PyObject *__pyx_v_hop, PyObject *__pyx_v_ramp, PyObject *__pyx_v_jitter, PyObject *__pyx_v_max_size, PyObject *__pyx_v_edit) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *__pyx_cur_scope;
  edit_cb __pyx_v_cy_edit_f_ptr;
  PyObject *__pyx_v_inp_f = 0;
  input_cb __pyx_v_cy_inp_f_ptr;
  PyObject *__pyx_v_edit_f = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_granulate", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct_3_make_granulate(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct_3_make_granulate, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 4343, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_inp = __pyx_v_inp;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inp);
  __pyx_cur_scope->__pyx_v_edit = __pyx_v_edit;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_edit);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_edit);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pysndlib.clm.make_granulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inp_f);
  __Pyx_XDECREF(__pyx_v_edit_f);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__504 = PyTuple_Pack(17, __pyx_n_s_inp, __pyx_n_s_expansion, __pyx_n_s_length, __pyx_n_s_scaler, __pyx_n_s_hop, __pyx_n_s_ramp, __pyx_n_s_jitter, __pyx_n_s_max_size, __pyx_n_s_edit, __pyx_n_s_cy_input_f_ptr, __pyx_n_s_cy_edit_f_ptr, __pyx_n_s_res, __pyx_n_s_inp_f, __pyx_n_s_inp_f, __pyx_n_s_cy_inp_f_ptr, __pyx_n_s_edit_f, __pyx_n_s_edit_f); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(0, 4343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__504);
  __Pyx_GIVEREF(__pyx_tuple__504);
  __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(9, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_granulate, 4343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) __PYX_ERR(0, 4343, __pyx_L1_error)
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_expansion, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_length, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_scaler, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_hop, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_ramp, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_jitter, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_max_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_485make_granulate, 0, __pyx_n_s_make_granulate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__505)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__506);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_granulate, __pyx_t_41) < 0) __PYX_ERR(0, 4343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__506 = PyTuple_Pack(8, ((PyObject*)__pyx_float_1_0), ((PyObject*)__pyx_float__15), ((PyObject*)__pyx_float__6), ((PyObject*)__pyx_float__05), ((PyObject*)__pyx_float__4), ((PyObject*)__pyx_float_0_0), ((PyObject *)__pyx_int_0), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(0, 4343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__506);
  __Pyx_GIVEREF(__pyx_tuple__506);
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate {
  PyObject_HEAD
  PyObject *__pyx_v_edit;
  PyObject *__pyx_v_inp;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_res;
};

 4344:                     expansion: Optional[float]=1.0,
 4345:                     length: Optional[float]=.15,
 4346:                     scaler: Optional[float]=.6,
 4347:                     hop: Optional[float]=.05,
 4348:                     ramp: Optional[float]=.4,
 4349:                     jitter: Optional[float]=0.0,
 4350:                     max_size: Optional[int]=0,
+4351:                     edit=None):
    values[8] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_expansion);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scaler);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hop);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ramp);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_jitter);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_size);
          if (value) { values[7] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_edit);
          if (value) { values[8] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_granulate") < 0)) __PYX_ERR(0, 4343, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_inp = values[0];
    __pyx_v_expansion = values[1];
    __pyx_v_length = values[2];
    __pyx_v_scaler = values[3];
    __pyx_v_hop = values[4];
    __pyx_v_ramp = values[5];
    __pyx_v_jitter = values[6];
    __pyx_v_max_size = values[7];
    __pyx_v_edit = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_granulate", 0, 1, 9, __pyx_nargs); __PYX_ERR(0, 4343, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_granulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_484make_granulate(__pyx_self, __pyx_v_inp, __pyx_v_expansion, __pyx_v_length, __pyx_v_scaler, __pyx_v_hop, __pyx_v_ramp, __pyx_v_jitter, __pyx_v_max_size, __pyx_v_edit);
 4352:                     
 4353:     """
 4354:     return a new granular synthesis generator.  'length' is the grain length (seconds), 'expansion' is the
 4355:     ratio \in timing between the new and old (expansion > 1.0 slows things down), 'scaler' scales the grains
 4356:     to avoid overflows, 'hop' is the spacing (seconds) between successive grains upon output. 'jitter'
 4357:     controls the randomness \in that spacing, 'input' can be a file pointer. 'edit' can be a function of one
 4358:     arg, the current granulate generator.  it is called just before a grain is added into the output
 4359:     buffer. the current grain is accessible via mus_data. the edit function, if any, should return the
 4360:     length \in samples of the grain, or 0.
 4361:     
 4362:     :param inp: gen or function to read from. if a callback, the function takes 1 input, the direction and should return read value
 4363:     :param expansion: how much to lengthen or compress the file
 4364:     :param length: length of file slices that are overlapped
 4365:     :param scaler: amplitude scaler on slices (to avoid overflows)
 4366:     :param hop: speed at which slices are repeated \in output
 4367:     :param ramp: amount of slice-time spent ramping up/down
 4368:     :param jitter: affects spacing of successive grains
 4369:     :param max_size: internal buffer size
 4370:     :param edit: grain editing function. the function should take one argument, the granulate mus_any and return length of grain or 0
 4371: 
 4372:     """
 4373: 
 4374:     cdef cclm.input_cb cy_input_f_ptr
 4375:     cdef cclm.edit_cb cy_edit_f_ptr
 4376: 
+4377:     if(isinstance(inp, mus_any) and edit is None):
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_8pysndlib_3clm_mus_any); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_edit == Py_None);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {
/* … */
  }
+4378:         res = mus_any.from_ptr(cclm.mus_make_granulate(<cclm.input_cb>input_callback_func, expansion, length, scaler, hop, ramp, jitter, max_size, NULL, <void*>(<mus_any>inp)._ptr))
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_expansion); if (unlikely((__pyx_t_4 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_length); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_scaler); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_hop); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_ramp); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_jitter); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4378, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_granulate(((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func), __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, NULL, ((void *)((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_inp)->_ptr)), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
+4379:         res._inputcallback = <cclm.input_cb>input_callback_func
    __pyx_cur_scope->__pyx_v_res->_inputcallback = ((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func);
+4380:         return res
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_res);
    __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_res);
    goto __pyx_L0;
 4381: 
+4382:     if not callable(inp):
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (!__pyx_t_1);
  if (unlikely(__pyx_t_3)) {
/* … */
  }
+4383:         raise TypeError(f"input needs to be a clm gen or function not a {type(inp)}")
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_inp)), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_kp_u_input_needs_to_be_a_clm_gen_or_f, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 4383, __pyx_L1_error)
 4384: 
+4385:     @INPUTCALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_14make_granulate_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_14make_granulate_1inp_f = {"inp_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_14make_granulate_1inp_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_14make_granulate_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  PyObject *__pyx_v_d = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_d,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4385, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4385, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, 1); __PYX_ERR(0, 4385, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "inp_f") < 0)) __PYX_ERR(0, 4385, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = values[0];
    __pyx_v_d = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4385, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_granulate.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_14make_granulate_inp_f(__pyx_self, __pyx_v_gen, __pyx_v_d);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_14make_granulate_inp_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen, PyObject *__pyx_v_d) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_granulate.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_INPUTCALLBACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_14make_granulate_1inp_f, 0, __pyx_n_s_make_granulate_locals_inp_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
      __pyx_t_10 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __pyx_v_inp_f = __pyx_t_2;
  __pyx_t_2 = 0;
/* … */
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_inp_f, 4385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 4385, __pyx_L1_error)
 4386:     def inp_f(gen, d):
+4387:         return inp(d)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_inp)) { __Pyx_RaiseClosureNameError("inp"); __PYX_ERR(0, 4387, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_inp; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4388: 
 4389: 
+4390:     cy_inp_f_ptr = (<cclm.input_cb*><size_t>ctypes.addressof(inp_f))[0]
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_addressof); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_10 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_inp_f};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cy_inp_f_ptr = (((input_cb *)((size_t)__pyx_t_14))[0]);
+4391:     res = mus_any.from_ptr(cclm.mus_make_granulate(<cclm.input_cb>cy_inp_f_ptr, expansion, length, scaler, hop, ramp, jitter, max_size, NULL, NULL))
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_expansion); if (unlikely((__pyx_t_9 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_length); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_scaler); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_hop); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_ramp); if (unlikely((__pyx_t_5 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_jitter); if (unlikely((__pyx_t_4 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_size); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4391, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_granulate(((input_cb)__pyx_v_cy_inp_f_ptr), __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_t_4, __pyx_t_10, NULL, NULL), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
  __pyx_t_2 = 0;
+4392:     res._inputcallback = cy_inp_f_ptr
  __pyx_cur_scope->__pyx_v_res->_inputcallback = __pyx_v_cy_inp_f_ptr;
+4393:     res.cache_append(inp_f)
  __pyx_t_2 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_v_inp_f, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4394: 
+4395:     if(edit is None):
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_edit == Py_None);
  if (__pyx_t_3) {
/* … */
  }
+4396:         return res
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_res);
    __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_res);
    goto __pyx_L0;
 4397: 
+4398:     @EDITCALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_14make_granulate_3edit_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_14make_granulate_3edit_f = {"edit_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_14make_granulate_3edit_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_14make_granulate_3edit_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edit_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4398, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "edit_f") < 0)) __PYX_ERR(0, 4398, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("edit_f", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4398, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_granulate.edit_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_14make_granulate_2edit_f(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_14make_granulate_2edit_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edit_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_3_make_granulate *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_granulate.edit_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_EDITCALLBACK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
/* … */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_gen); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 4398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_14make_granulate_3edit_f, 0, __pyx_n_s_make_granulate_locals_edit_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_10 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_11};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_v_edit_f = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_edit_f, 4398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 4398, __pyx_L1_error)
 4399:     def edit_f(gen):
+4400:         return edit(res)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_edit)) { __Pyx_RaiseClosureNameError("edit"); __PYX_ERR(0, 4400, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_res)) { __Pyx_RaiseClosureNameError("res"); __PYX_ERR(0, 4400, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_edit);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_edit; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_res)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4401: 
+4402:     cy_edit_f_ptr = (<cclm.edit_cb*><size_t>ctypes.addressof(edit_f))[0]
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_addressof); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
      __pyx_t_10 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_edit_f};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cy_edit_f_ptr = (((edit_cb *)((size_t)__pyx_t_14))[0]);
+4403:     cclm.mus_granulate_set_edit_function(res._ptr, cy_edit_f_ptr)
  mus_granulate_set_edit_function(__pyx_cur_scope->__pyx_v_res->_ptr, __pyx_v_cy_edit_f_ptr);
+4404:     res._editcallback  = cy_edit_f_ptr
  __pyx_cur_scope->__pyx_v_res->_editcallback = __pyx_v_cy_edit_f_ptr;
+4405:     res.cache_append(edit_f)
  __pyx_t_2 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_v_edit_f, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4406: 
+4407:     return res
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_res);
  goto __pyx_L0;
 4408: 
 4409: #todo: mus_granulate_grain_max_length
+4410: cpdef cython.double granulate(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_487granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_granulate(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("granulate", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_487granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_486granulate, "\n    next sample from granular synthesis generator.\n    \n    :param gen: granulate gen\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_487granulate = {"granulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_487granulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_486granulate};
static PyObject *__pyx_pw_8pysndlib_3clm_487granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("granulate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4410, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "granulate") < 0)) __PYX_ERR(0, 4410, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("granulate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4410, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.granulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4410, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_486granulate(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_486granulate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("granulate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_granulate(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4410, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.granulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4410, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_487granulate, 0, __pyx_n_s_granulate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__507)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_granulate, __pyx_t_40) < 0) __PYX_ERR(0, 4410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_granulate, 4410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) __PYX_ERR(0, 4410, __pyx_L1_error)
 4411:     """
 4412:     next sample from granular synthesis generator.
 4413:     
 4414:     :param gen: granulate gen
 4415:     :rtype: float
 4416:     
 4417:     """
+4418:     if gen._editcallback is not NULL:
  __pyx_t_1 = (__pyx_v_gen->_editcallback != NULL);
  if (__pyx_t_1) {
/* … */
  }
+4419:         return cclm.mus_granulate_with_editor(gen._ptr, <cclm.input_cb>gen._inputcallback, <cclm.edit_cb>gen._editcallback)
    __pyx_r = mus_granulate_with_editor(__pyx_v_gen->_ptr, ((input_cb)__pyx_v_gen->_inputcallback), ((edit_cb)__pyx_v_gen->_editcallback));
    goto __pyx_L0;
 4420:     else:
+4421:         return cclm.mus_granulate(gen._ptr, <cclm.input_cb>gen._inputcallback)
  /*else*/ {
    __pyx_r = mus_granulate(__pyx_v_gen->_ptr, ((input_cb)__pyx_v_gen->_inputcallback));
    goto __pyx_L0;
  }
 4422: 
 4423: 
+4424: cpdef bint is_granulate(e: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_489is_granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_granulate(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_e, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_granulate", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_489is_granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_488is_granulate, "\n    returns True if gen is a granulate.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_489is_granulate = {"is_granulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_489is_granulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_488is_granulate};
static PyObject *__pyx_pw_8pysndlib_3clm_489is_granulate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_e = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_granulate (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4424, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_granulate") < 0)) __PYX_ERR(0, 4424, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_e = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_granulate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4424, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_granulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "e", 0))) __PYX_ERR(0, 4424, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_488is_granulate(__pyx_self, __pyx_v_e);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_488is_granulate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_granulate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_granulate(__pyx_v_e, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4424, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_granulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__508 = PyTuple_Pack(1, __pyx_n_s_e); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(0, 4424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__508);
  __Pyx_GIVEREF(__pyx_tuple__508);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_e, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4424, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_489is_granulate, 0, __pyx_n_s_is_granulate, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__509)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_granulate, __pyx_t_41) < 0) __PYX_ERR(0, 4424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_granulate, 4424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) __PYX_ERR(0, 4424, __pyx_L1_error)
 4425:     """
 4426:     returns True if gen is a granulate.
 4427:     
 4428:     :param gen: gen
 4429:     :rtype: bool
 4430:     """
+4431:     return cclm.mus_is_granulate(e._ptr)
  __pyx_r = mus_is_granulate(__pyx_v_e->_ptr);
  goto __pyx_L0;
 4432: 
 4433: #--------------- phase-vocoder ----------------#
+4434: def make_phase_vocoder(inp,
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_491make_phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_490make_phase_vocoder, "\n    return a new phase-vocoder generator; input is the input function (it can be set at run-time),\n    analyze, edit, and synthesize are either None or functions that replace the default innards of the\n    generator, fft_size, overlap and interp set the fft_size, the amount of overlap between ffts, and the\n    time between new analysis calls. 'analyze', if given, takes 2 args, the generator and the input\n    function; if it returns True, the default analysis code is also called.  'edit', if given, takes 1 arg,\n    the generator; if it returns True, the default edit code is run.  'synthesize' is a function of 1 arg,\n    the generator; it is called to get the current vocoder output.\n    \n    :param inp: gen or function to read from. if a callback, the function takes 1 input, the direction and should return read value\n    :param fft_size: fft size used\n    :param overlap: how many analysis stages overlap\n    :param interp: samples between fft\n    :param pitch: pitch scaling ratio\n    :param analyze: if used, overrides default. should be a function of two arguments, the generator and the input function. \n    :param edit: if used, overrides default. functions of one argument, the phase_vocoder mus_any. change amplitudes and phases\n    :param synthesize: if used, overrides default. unctions of one argument, the phase_vocoder mus_any.\n    :return: phase_vocoder gen\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_491make_phase_vocoder = {"make_phase_vocoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_491make_phase_vocoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_490make_phase_vocoder};
static PyObject *__pyx_pw_8pysndlib_3clm_491make_phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_inp = 0;
  PyObject *__pyx_v_fft_size = 0;
  PyObject *__pyx_v_overlap = 0;
  PyObject *__pyx_v_interp = 0;
  PyObject *__pyx_v_pitch = 0;
  PyObject *__pyx_v_analyze = 0;
  PyObject *__pyx_v_edit = 0;
  PyObject *__pyx_v_synthesize = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_phase_vocoder (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inp,&__pyx_n_s_fft_size,&__pyx_n_s_overlap,&__pyx_n_s_interp,&__pyx_n_s_pitch,&__pyx_n_s_analyze,&__pyx_n_s_edit,&__pyx_n_s_synthesize,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_512));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_4));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_128));
    values[4] = ((PyObject *)((PyObject*)__pyx_float_1_0));
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_490make_phase_vocoder(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_inp, PyObject *__pyx_v_fft_size, PyObject *__pyx_v_overlap, PyObject *__pyx_v_interp, PyObject *__pyx_v_pitch, PyObject *__pyx_v_analyze, PyObject *__pyx_v_edit, PyObject *__pyx_v_synthesize) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_cur_scope;
  input_cb __pyx_v_cy_inp_f_ptr;
  edit_cb __pyx_v_cy_edit_f_ptr;
  analyze_cb __pyx_v_cy_analyze_f_ptr;
  synthesize_cb __pyx_v_cy_synthesize_f_ptr;
  PyObject *__pyx_v_inp_f = 0;
  PyObject *__pyx_v_edit_f = 0;
  PyObject *__pyx_v_analyze_f = 0;
  PyObject *__pyx_v_synthesize_f = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_phase_vocoder", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 4434, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_inp = __pyx_v_inp;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inp);
  __pyx_cur_scope->__pyx_v_analyze = __pyx_v_analyze;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_analyze);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_analyze);
  __pyx_cur_scope->__pyx_v_edit = __pyx_v_edit;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_edit);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_edit);
  __pyx_cur_scope->__pyx_v_synthesize = __pyx_v_synthesize;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_synthesize);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_synthesize);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inp_f);
  __Pyx_XDECREF(__pyx_v_edit_f);
  __Pyx_XDECREF(__pyx_v_analyze_f);
  __Pyx_XDECREF(__pyx_v_synthesize_f);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__510 = PyTuple_Pack(21, __pyx_n_s_inp, __pyx_n_s_fft_size, __pyx_n_s_overlap, __pyx_n_s_interp, __pyx_n_s_pitch, __pyx_n_s_analyze, __pyx_n_s_edit, __pyx_n_s_synthesize, __pyx_n_s_cy_inp_f_ptr, __pyx_n_s_cy_edit_f_ptr, __pyx_n_s_cy_analyze_f_ptr, __pyx_n_s_cy_synthesize_f_ptr, __pyx_n_s_res, __pyx_n_s_inp_f, __pyx_n_s_inp_f, __pyx_n_s_edit_f, __pyx_n_s_edit_f, __pyx_n_s_analyze_f, __pyx_n_s_analyze_f, __pyx_n_s_synthesize_f, __pyx_n_s_synthesize_f); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(0, 4434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__510);
  __Pyx_GIVEREF(__pyx_tuple__510);
  __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_phase_vocoder, 4434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) __PYX_ERR(0, 4434, __pyx_L1_error)
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_fft_size, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4434, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_overlap, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4434, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_interp, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4434, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_pitch, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4434, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_491make_phase_vocoder, 0, __pyx_n_s_make_phase_vocoder, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__511)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__512);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_phase_vocoder, __pyx_t_40) < 0) __PYX_ERR(0, 4434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_tuple__512 = PyTuple_Pack(7, ((PyObject *)__pyx_int_512), ((PyObject *)__pyx_int_4), ((PyObject *)__pyx_int_128), ((PyObject*)__pyx_float_1_0), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(0, 4434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__512);
  __Pyx_GIVEREF(__pyx_tuple__512);
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder {
  PyObject_HEAD
  PyObject *__pyx_v_analyze;
  PyObject *__pyx_v_edit;
  PyObject *__pyx_v_inp;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_res;
  PyObject *__pyx_v_synthesize;
};

 4435:                         fft_size: Optional[int]=512,
 4436:                         overlap: Optional[int]=4,
 4437:                         interp: Optional[int]=128,
 4438:                         pitch: Optional[float]=1.0,
+4439:                         analyze=None,
    values[5] = ((PyObject *)((PyObject *)Py_None));
+4440:                         edit=None,
    values[6] = ((PyObject *)((PyObject *)Py_None));
+4441:                         synthesize=None):
    values[7] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fft_size);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pitch);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_analyze);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_edit);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_synthesize);
          if (value) { values[7] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_phase_vocoder") < 0)) __PYX_ERR(0, 4434, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_inp = values[0];
    __pyx_v_fft_size = values[1];
    __pyx_v_overlap = values[2];
    __pyx_v_interp = values[3];
    __pyx_v_pitch = values[4];
    __pyx_v_analyze = values[5];
    __pyx_v_edit = values[6];
    __pyx_v_synthesize = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_phase_vocoder", 0, 1, 8, __pyx_nargs); __PYX_ERR(0, 4434, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_490make_phase_vocoder(__pyx_self, __pyx_v_inp, __pyx_v_fft_size, __pyx_v_overlap, __pyx_v_interp, __pyx_v_pitch, __pyx_v_analyze, __pyx_v_edit, __pyx_v_synthesize);
 4442:                         
 4443:     """
 4444:     return a new phase-vocoder generator; input is the input function (it can be set at run-time),
 4445:     analyze, edit, and synthesize are either None or functions that replace the default innards of the
 4446:     generator, fft_size, overlap and interp set the fft_size, the amount of overlap between ffts, and the
 4447:     time between new analysis calls. 'analyze', if given, takes 2 args, the generator and the input
 4448:     function; if it returns True, the default analysis code is also called.  'edit', if given, takes 1 arg,
 4449:     the generator; if it returns True, the default edit code is run.  'synthesize' is a function of 1 arg,
 4450:     the generator; it is called to get the current vocoder output.
 4451:     
 4452:     :param inp: gen or function to read from. if a callback, the function takes 1 input, the direction and should return read value
 4453:     :param fft_size: fft size used
 4454:     :param overlap: how many analysis stages overlap
 4455:     :param interp: samples between fft
 4456:     :param pitch: pitch scaling ratio
 4457:     :param analyze: if used, overrides default. should be a function of two arguments, the generator and the input function. 
 4458:     :param edit: if used, overrides default. functions of one argument, the phase_vocoder mus_any. change amplitudes and phases
 4459:     :param synthesize: if used, overrides default. unctions of one argument, the phase_vocoder mus_any.
 4460:     :return: phase_vocoder gen
 4461:     
 4462:     """
 4463: 
 4464:     cdef cclm.input_cb cy_inp_f_ptr
 4465:     cdef cclm.edit_cb cy_edit_f_ptr
 4466:     cdef cclm.analyze_cb cy_analyze_f_ptr
 4467:     cdef cclm.synthesize_cb cy_synthesize_f_ptr
 4468: 
+4469:     if fft_size <= 1:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_fft_size, __pyx_int_1, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4469, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+4470:         raise ValueError(f'fft_size must be a positive number greater than 1 not {fft_size}')
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_fft_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_fft_size_must_be_a_positive_numb_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 4470, __pyx_L1_error)
 4471: 
+4472:     if fft_size > csndlib.mus_max_malloc():
  __pyx_t_1 = __Pyx_PyInt_From_mus_long_t(mus_max_malloc()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fft_size, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+4473:          raise ValueError(f'fft_size too large. cannot allocate {fft_size} size fft')
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_fft_size_too_large_cannot_alloca);
    __pyx_t_4 += 36;
    __Pyx_GIVEREF(__pyx_kp_u_fft_size_too_large_cannot_alloca);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_fft_size_too_large_cannot_alloca);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_fft_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_size_fft);
    __pyx_t_4 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_size_fft);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_size_fft);
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4473, __pyx_L1_error)
 4474: 
+4475:     if not is_power_of_2(fft_size):
  __pyx_t_3 = __pyx_f_8pysndlib_3clm_is_power_of_2(__pyx_v_fft_size, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (!__pyx_t_2);
  if (unlikely(__pyx_t_6)) {
/* … */
  }
+4476:         raise ValueError(f'fft_size must be power of 2 not {fft_size}')
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_fft_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_fft_size_must_be_power_of_2_not, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4476, __pyx_L1_error)
 4477: 
+4478:     if(isinstance(inp, mus_any)):
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_TypeCheck(__pyx_t_3, __pyx_ptype_8pysndlib_3clm_mus_any); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {
/* … */
    goto __pyx_L6;
  }
+4479:         res = mus_any.from_ptr(cclm.mus_make_phase_vocoder(<cclm.input_cb>input_callback_func, fft_size, overlap, interp, pitch, NULL, NULL, NULL, <void*>(<mus_any>inp)._ptr))
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_fft_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4479, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_overlap); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4479, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_interp); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4479, __pyx_L1_error)
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_pitch); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4479, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_phase_vocoder(((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func), __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, NULL, NULL, NULL, ((void *)((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_inp)->_ptr)), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
    __pyx_t_3 = 0;
+4480:         res._inputcallback = <cclm.input_cb>input_callback_func
    __pyx_cur_scope->__pyx_v_res->_inputcallback = ((input_cb)__pyx_f_8pysndlib_3clm_input_callback_func);
+4481:         res.cache_append(inp)
    __pyx_t_3 = __pyx_cur_scope->__pyx_v_inp;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_t_3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4482:     elif callable(inp):
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_inp;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 4482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_6)) {
/* … */
    goto __pyx_L6;
  }
+4483:         @INPUTCALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_1inp_f = {"inp_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_1inp_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_1inp_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  PyObject *__pyx_v_d = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_d,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_d)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, 1); __PYX_ERR(0, 4483, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "inp_f") < 0)) __PYX_ERR(0, 4483, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = values[0];
    __pyx_v_d = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inp_f", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4483, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_18make_phase_vocoder_inp_f(__pyx_self, __pyx_v_gen, __pyx_v_d);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_18make_phase_vocoder_inp_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen, PyObject *__pyx_v_d) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inp_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.inp_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_INPUTCALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_1inp_f, 0, __pyx_n_s_make_phase_vocoder_locals_inp_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_inp_f = __pyx_t_1;
    __pyx_t_1 = 0;
/* … */
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_inp_f, 4483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 4483, __pyx_L1_error)
 4484:         def inp_f(gen, d):
+4485:             return inp(d)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_inp)) { __Pyx_RaiseClosureNameError("inp"); __PYX_ERR(0, 4485, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inp);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_inp; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
+4486:         cy_inp_f_ptr = (<cclm.input_cb*><size_t>ctypes.addressof(inp_f))[0]
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_addressof); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_inp_f};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4486, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cy_inp_f_ptr = (((input_cb *)((size_t)__pyx_t_13))[0]);
+4487:         res = mus_any.from_ptr(cclm.mus_make_phase_vocoder(cy_inp_f_ptr, fft_size, overlap, interp, pitch, NULL, NULL, NULL, NULL))
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_fft_size); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4487, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_overlap); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4487, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_interp); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4487, __pyx_L1_error)
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_pitch); if (unlikely((__pyx_t_10 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4487, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_phase_vocoder(__pyx_v_cy_inp_f_ptr, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_10, NULL, NULL, NULL, NULL), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
+4488:         res._inputcallback = cy_inp_f_ptr
    __pyx_cur_scope->__pyx_v_res->_inputcallback = __pyx_v_cy_inp_f_ptr;
+4489:         res.cache_append(inp_f)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_v_inp_f, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4490: 
 4491:     else:
+4492:         raise TypeError(f"input needs to be a clm gen or a callable not a {type(inp)}")
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_inp)), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_kp_u_input_needs_to_be_a_clm_gen_or_a, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 4492, __pyx_L1_error)
  }
  __pyx_L6:;
 4493: 
+4494:     if(edit is not None):
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_edit != Py_None);
  if (__pyx_t_6) {
/* … */
  }
+4495:         @EDITCALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_3edit_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_3edit_f = {"edit_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_3edit_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_3edit_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edit_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4495, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "edit_f") < 0)) __PYX_ERR(0, 4495, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("edit_f", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4495, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.edit_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_18make_phase_vocoder_2edit_f(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_18make_phase_vocoder_2edit_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("edit_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.edit_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_EDITCALLBACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_3edit_f, 0, __pyx_n_s_make_phase_vocoder_locals_edit_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_v_edit_f = __pyx_t_1;
    __pyx_t_1 = 0;
/* … */
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_edit_f, 4495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 4495, __pyx_L1_error)
 4496:         def edit_f(gen):
+4497:             return edit(res)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_edit)) { __Pyx_RaiseClosureNameError("edit"); __PYX_ERR(0, 4497, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_res)) { __Pyx_RaiseClosureNameError("res"); __PYX_ERR(0, 4497, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_edit);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_edit; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_res)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
+4498:         cy_edit_f_ptr = (<cclm.edit_cb*><size_t>ctypes.addressof(edit_f))[0]
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_addressof); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_edit_f};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4498, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cy_edit_f_ptr = (((edit_cb *)((size_t)__pyx_t_13))[0]);
+4499:         res._editcallback  = cy_edit_f_ptr
    __pyx_cur_scope->__pyx_v_res->_editcallback = __pyx_v_cy_edit_f_ptr;
+4500:         res.cache_append(edit_f)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_v_edit_f, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4501: 
+4502:     if (analyze is not None):
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_analyze != Py_None);
  if (__pyx_t_6) {
/* … */
  }
+4503:         @ANALYZECALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_5analyze_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_5analyze_f = {"analyze_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_5analyze_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_5analyze_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  CYTHON_UNUSED PyObject *__pyx_v_func = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("analyze_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4503, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4503, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("analyze_f", 1, 2, 2, 1); __PYX_ERR(0, 4503, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "analyze_f") < 0)) __PYX_ERR(0, 4503, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("analyze_f", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4503, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.analyze_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_18make_phase_vocoder_4analyze_f(__pyx_self, __pyx_v_gen, __pyx_v_func);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_18make_phase_vocoder_4analyze_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen, CYTHON_UNUSED PyObject *__pyx_v_func) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("analyze_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.analyze_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ANALYZECALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
/* … */
  __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_func); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 4503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
    __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_5analyze_f, 0, __pyx_n_s_make_phase_vocoder_locals_analyz, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_analyze_f = __pyx_t_1;
    __pyx_t_1 = 0;
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_analyze_f, 4503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 4503, __pyx_L1_error)
 4504:         def analyze_f(gen, func):
+4505:             return analyze(res, inp)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_analyze)) { __Pyx_RaiseClosureNameError("analyze"); __PYX_ERR(0, 4505, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_res)) { __Pyx_RaiseClosureNameError("res"); __PYX_ERR(0, 4505, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_inp)) { __Pyx_RaiseClosureNameError("inp"); __PYX_ERR(0, 4505, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_analyze);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_analyze; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_res), __pyx_cur_scope->__pyx_v_inp};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
+4506:         cy_analyze_f_ptr = (<cclm.analyze_cb*><size_t>ctypes.addressof(analyze_f))[0]
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_addressof); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_analyze_f};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cy_analyze_f_ptr = (((analyze_cb *)((size_t)__pyx_t_13))[0]);
+4507:         res._analyzecallback  = cy_analyze_f_ptr
    __pyx_cur_scope->__pyx_v_res->_analyzecallback = __pyx_v_cy_analyze_f_ptr;
+4508:         res.cache_append(analyze_f)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_v_analyze_f, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4509: 
+4510:     if (synthesize is not None):
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_synthesize != Py_None);
  if (__pyx_t_6) {
/* … */
  }
+4511:         @SYNTHESIZECALLBACK
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_7synthesize_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_7synthesize_f = {"synthesize_f", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_7synthesize_f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_18make_phase_vocoder_7synthesize_f(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("synthesize_f (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4511, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "synthesize_f") < 0)) __PYX_ERR(0, 4511, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("synthesize_f", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4511, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.synthesize_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_18make_phase_vocoder_6synthesize_f(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_18make_phase_vocoder_6synthesize_f(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_gen) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("synthesize_f", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_4_make_phase_vocoder *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.make_phase_vocoder.synthesize_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_SYNTHESIZECALLBACK); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_18make_phase_vocoder_7synthesize_f, 0, __pyx_n_s_make_phase_vocoder_locals_synthe, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_v_synthesize_f = __pyx_t_1;
    __pyx_t_1 = 0;
/* … */
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_synthesize_f, 4511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 4511, __pyx_L1_error)
 4512:         def synthesize_f(gen):
+4513:             return synthesize(res)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_synthesize)) { __Pyx_RaiseClosureNameError("synthesize"); __PYX_ERR(0, 4513, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_res)) { __Pyx_RaiseClosureNameError("res"); __PYX_ERR(0, 4513, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_synthesize);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_synthesize; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_res)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
+4514:         cy_synthesize_f_ptr = (<cclm.synthesize_cb*><size_t>ctypes.addressof(synthesize_f))[0]
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_addressof); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_synthesize_f};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4514, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cy_synthesize_f_ptr = (((synthesize_cb *)((size_t)__pyx_t_13))[0]);
+4515:         res._synthesizecallback = cy_synthesize_f_ptr
    __pyx_cur_scope->__pyx_v_res->_synthesizecallback = __pyx_v_cy_synthesize_f_ptr;
+4516:         res.cache_append(synthesize_f)
    __pyx_t_1 = ((struct __pyx_vtabstruct_8pysndlib_3clm_mus_any *)__pyx_cur_scope->__pyx_v_res->__pyx_vtab)->cache_append(__pyx_cur_scope->__pyx_v_res, __pyx_v_synthesize_f, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 4517: 
+4518:     return res
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_res);
  __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_res);
  goto __pyx_L0;
 4519: 
 4520: 
+4521: cpdef cython.double phase_vocoder(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_493phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_phase_vocoder(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_493phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_492phase_vocoder, "\n    next phase vocoder value.\n    \n    :param gen: phase_vocoder gen\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_493phase_vocoder = {"phase_vocoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_493phase_vocoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_492phase_vocoder};
static PyObject *__pyx_pw_8pysndlib_3clm_493phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4521, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_vocoder") < 0)) __PYX_ERR(0, 4521, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_vocoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4521, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4521, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_492phase_vocoder(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_492phase_vocoder(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_phase_vocoder(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4521, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4521, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_493phase_vocoder, 0, __pyx_n_s_phase_vocoder, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__513)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_vocoder, __pyx_t_41) < 0) __PYX_ERR(0, 4521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_vocoder, 4521, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) __PYX_ERR(0, 4521, __pyx_L1_error)
 4522:     """
 4523:     next phase vocoder value.
 4524:     
 4525:     :param gen: phase_vocoder gen
 4526:     :rtype: float
 4527:     """
+4528:     if gen._analyzecallback or gen._synthesizecallback or gen._editcallback :
  __pyx_t_2 = (__pyx_v_gen->_analyzecallback != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_gen->_synthesizecallback != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_gen->_editcallback != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {
/* … */
  }
+4529:         return cclm.mus_phase_vocoder_with_editors(gen._ptr, gen._inputcallback, gen._analyzecallback, gen._editcallback, gen._synthesizecallback)
    __pyx_r = mus_phase_vocoder_with_editors(__pyx_v_gen->_ptr, __pyx_v_gen->_inputcallback, __pyx_v_gen->_analyzecallback, __pyx_v_gen->_editcallback, __pyx_v_gen->_synthesizecallback);
    goto __pyx_L0;
 4530:     else:
+4531:         return cclm.mus_phase_vocoder(gen._ptr, gen._inputcallback)
  /*else*/ {
    __pyx_r = mus_phase_vocoder(__pyx_v_gen->_ptr, __pyx_v_gen->_inputcallback);
    goto __pyx_L0;
  }
 4532: 
+4533: cpdef bint is_phase_vocoder(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_495is_phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_phase_vocoder(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_phase_vocoder", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_495is_phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_494is_phase_vocoder, "\n    returns True if gen is a phase_vocoder.\n    \n    :param gen: gen\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_495is_phase_vocoder = {"is_phase_vocoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_495is_phase_vocoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_494is_phase_vocoder};
static PyObject *__pyx_pw_8pysndlib_3clm_495is_phase_vocoder(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_phase_vocoder (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4533, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_phase_vocoder") < 0)) __PYX_ERR(0, 4533, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_phase_vocoder", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4533, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_phase_vocoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4533, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_494is_phase_vocoder(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_494is_phase_vocoder(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_phase_vocoder", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_phase_vocoder(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4533, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_phase_vocoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4533, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_495is_phase_vocoder, 0, __pyx_n_s_is_phase_vocoder, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__514)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_phase_vocoder, __pyx_t_40) < 0) __PYX_ERR(0, 4533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__514 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_phase_vocoder, 4533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__514)) __PYX_ERR(0, 4533, __pyx_L1_error)
 4534:     """
 4535:     returns True if gen is a phase_vocoder.
 4536:     
 4537:     :param gen: gen
 4538:     :rtype: bool
 4539:     """
+4540:     return cclm.mus_is_phase_vocoder(gen._ptr)
  __pyx_r = mus_is_phase_vocoder(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4541: 
 4542: 
+4543: cpdef np.ndarray phase_vocoder_amp_increments(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_497phase_vocoder_amp_increments(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_phase_vocoder_amp_increments(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_amp_increments", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_497phase_vocoder_amp_increments(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_496phase_vocoder_amp_increments, "\n    returns a ndarray containing the current output sinusoid amplitude increments per sample.\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_497phase_vocoder_amp_increments = {"phase_vocoder_amp_increments", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_497phase_vocoder_amp_increments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_496phase_vocoder_amp_increments};
static PyObject *__pyx_pw_8pysndlib_3clm_497phase_vocoder_amp_increments(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_amp_increments (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4543, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_vocoder_amp_increments") < 0)) __PYX_ERR(0, 4543, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_vocoder_amp_increments", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4543, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_amp_increments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4543, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_496phase_vocoder_amp_increments(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_496phase_vocoder_amp_increments(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_amp_increments", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_phase_vocoder_amp_increments(__pyx_v_gen, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_amp_increments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4543, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_497phase_vocoder_amp_increments, 0, __pyx_n_s_phase_vocoder_amp_increments, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_vocoder_amp_increments, __pyx_t_41) < 0) __PYX_ERR(0, 4543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_vocoder_amp_increments, 4543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(0, 4543, __pyx_L1_error)
 4544:     """
 4545:     returns a ndarray containing the current output sinusoid amplitude increments per sample.
 4546:     """
+4547:     return gen._pv_amp_increments
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen->_pv_amp_increments);
  __pyx_r = __pyx_v_gen->_pv_amp_increments;
  goto __pyx_L0;
 4548: 
+4549: cpdef np.ndarray phase_vocoder_amps(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_499phase_vocoder_amps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_phase_vocoder_amps(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_amps", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_499phase_vocoder_amps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_498phase_vocoder_amps, "\n    returns a ndarray containing the current output sinusoid amplitudes.\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_499phase_vocoder_amps = {"phase_vocoder_amps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_499phase_vocoder_amps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_498phase_vocoder_amps};
static PyObject *__pyx_pw_8pysndlib_3clm_499phase_vocoder_amps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_amps (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4549, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_vocoder_amps") < 0)) __PYX_ERR(0, 4549, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_vocoder_amps", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4549, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_amps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4549, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_498phase_vocoder_amps(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_498phase_vocoder_amps(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_amps", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_phase_vocoder_amps(__pyx_v_gen, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_amps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4549, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_499phase_vocoder_amps, 0, __pyx_n_s_phase_vocoder_amps, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__516)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_vocoder_amps, __pyx_t_40) < 0) __PYX_ERR(0, 4549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__516 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_vocoder_amps, 4549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__516)) __PYX_ERR(0, 4549, __pyx_L1_error)
 4550:     """
 4551:     returns a ndarray containing the current output sinusoid amplitudes.
 4552:     """
+4553:     return gen._pv_amps
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen->_pv_amps);
  __pyx_r = __pyx_v_gen->_pv_amps;
  goto __pyx_L0;
 4554: 
+4555: cpdef  np.ndarray phase_vocoder_freqs(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_501phase_vocoder_freqs(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_phase_vocoder_freqs(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_freqs", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_501phase_vocoder_freqs(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_500phase_vocoder_freqs, "\n    returns a ndarray containing the current output sinusoid frequencies.\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_501phase_vocoder_freqs = {"phase_vocoder_freqs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_501phase_vocoder_freqs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_500phase_vocoder_freqs};
static PyObject *__pyx_pw_8pysndlib_3clm_501phase_vocoder_freqs(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_freqs (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4555, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_vocoder_freqs") < 0)) __PYX_ERR(0, 4555, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_vocoder_freqs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4555, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_freqs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4555, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_500phase_vocoder_freqs(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_500phase_vocoder_freqs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_freqs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_phase_vocoder_freqs(__pyx_v_gen, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_freqs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4555, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_501phase_vocoder_freqs, 0, __pyx_n_s_phase_vocoder_freqs, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__517)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_vocoder_freqs, __pyx_t_41) < 0) __PYX_ERR(0, 4555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__517 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_vocoder_freqs, 4555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__517)) __PYX_ERR(0, 4555, __pyx_L1_error)
 4556:     """
 4557:     returns a ndarray containing the current output sinusoid frequencies.
 4558:     """
+4559:     return gen._pv_freqs
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen->_pv_freqs);
  __pyx_r = __pyx_v_gen->_pv_freqs;
  goto __pyx_L0;
 4560: 
+4561: cpdef  np.ndarray phase_vocoder_phases(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_503phase_vocoder_phases(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_phase_vocoder_phases(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_phases", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_503phase_vocoder_phases(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_502phase_vocoder_phases, "\n    returns a ndarray containing the current output sinusoid phases.\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_503phase_vocoder_phases = {"phase_vocoder_phases", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_503phase_vocoder_phases, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_502phase_vocoder_phases};
static PyObject *__pyx_pw_8pysndlib_3clm_503phase_vocoder_phases(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_phases (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4561, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_vocoder_phases") < 0)) __PYX_ERR(0, 4561, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_vocoder_phases", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4561, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_phases", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4561, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_502phase_vocoder_phases(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_502phase_vocoder_phases(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_phases", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_phase_vocoder_phases(__pyx_v_gen, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_phases", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4561, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_503phase_vocoder_phases, 0, __pyx_n_s_phase_vocoder_phases, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__518)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_vocoder_phases, __pyx_t_40) < 0) __PYX_ERR(0, 4561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__518 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_vocoder_phases, 4561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__518)) __PYX_ERR(0, 4561, __pyx_L1_error)
 4562:     """
 4563:     returns a ndarray containing the current output sinusoid phases.
 4564:     """
+4565:     return gen._pv_phases
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen->_pv_phases);
  __pyx_r = __pyx_v_gen->_pv_phases;
  goto __pyx_L0;
 4566: 
+4567: cpdef  np.ndarray phase_vocoder_phase_increments(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_505phase_vocoder_phase_increments(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_8pysndlib_3clm_phase_vocoder_phase_increments(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_phase_increments", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_505phase_vocoder_phase_increments(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_504phase_vocoder_phase_increments, "\n    returns a ndarray containing the current output sinusoid phase increments.\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_505phase_vocoder_phase_increments = {"phase_vocoder_phase_increments", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_505phase_vocoder_phase_increments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_504phase_vocoder_phase_increments};
static PyObject *__pyx_pw_8pysndlib_3clm_505phase_vocoder_phase_increments(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_phase_increments (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4567, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "phase_vocoder_phase_increments") < 0)) __PYX_ERR(0, 4567, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("phase_vocoder_phase_increments", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4567, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_phase_increments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4567, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_504phase_vocoder_phase_increments(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_504phase_vocoder_phase_increments(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("phase_vocoder_phase_increments", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_phase_vocoder_phase_increments(__pyx_v_gen, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.phase_vocoder_phase_increments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_505phase_vocoder_phase_increments, 0, __pyx_n_s_phase_vocoder_phase_increments, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__519)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_vocoder_phase_increments, __pyx_t_41) < 0) __PYX_ERR(0, 4567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_phase_vocoder_phase_increments, 4567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) __PYX_ERR(0, 4567, __pyx_L1_error)
 4568:     """
 4569:     returns a ndarray containing the current output sinusoid phase increments.
 4570:     """
+4571:     return gen._pv_phase_increments
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen->_pv_phase_increments);
  __pyx_r = __pyx_v_gen->_pv_phase_increments;
  goto __pyx_L0;
 4572: 
 4573: # --------------- out-any ---------------- #
+4574: cpdef out_any(loc: int, data: float, channel, output):
static PyObject *__pyx_pw_8pysndlib_3clm_507out_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_out_any(PyObject *__pyx_v_loc, double __pyx_v_data, PyObject *__pyx_v_channel, PyObject *__pyx_v_output, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_any", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.out_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_507out_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_506out_any, "\n    add data to output.\n    \n    :param loc: location to write to \\in samples\n    :param data: sample value\n    :param channel: channel to write to \n    :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_507out_any = {"out_any", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_507out_any, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_506out_any};
static PyObject *__pyx_pw_8pysndlib_3clm_507out_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_data;
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_output = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_any (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_data,&__pyx_n_s_channel,&__pyx_n_s_output,0};
    PyObject* values[4] = {0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4574, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4574, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("out_any", 1, 4, 4, 1); __PYX_ERR(0, 4574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channel)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4574, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("out_any", 1, 4, 4, 2); __PYX_ERR(0, 4574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4574, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("out_any", 1, 4, 4, 3); __PYX_ERR(0, 4574, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "out_any") < 0)) __PYX_ERR(0, 4574, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_data = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_data == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4574, __pyx_L3_error)
    __pyx_v_channel = values[2];
    __pyx_v_output = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("out_any", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 4574, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.out_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4574, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_506out_any(__pyx_self, __pyx_v_loc, __pyx_v_data, __pyx_v_channel, __pyx_v_output);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_506out_any(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, double __pyx_v_data, PyObject *__pyx_v_channel, PyObject *__pyx_v_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_any", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_v_channel, __pyx_v_output, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.out_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__520 = PyTuple_Pack(4, __pyx_n_s_loc, __pyx_n_s_data, __pyx_n_s_channel, __pyx_n_s_output); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(0, 4574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__520);
  __Pyx_GIVEREF(__pyx_tuple__520);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4574, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_data, __pyx_n_s_float) < 0) __PYX_ERR(0, 4574, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_507out_any, 0, __pyx_n_s_out_any, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__521)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_out_any, __pyx_t_40) < 0) __PYX_ERR(0, 4574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_out_any, 4574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) __PYX_ERR(0, 4574, __pyx_L1_error)
 4575:     """
 4576:     add data to output.
 4577:     
 4578:     :param loc: location to write to \in samples
 4579:     :param data: sample value
 4580:     :param channel: channel to write to 
 4581:     :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file
 4582:     :return: data
 4583:     :rtype: float
 4584:     """
+4585:     if isinstance(output, np.ndarray):
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_output, __pyx_ptype_5numpy_ndarray); 
  if (__pyx_t_1) {
/* … */
    goto __pyx_L3;
  }
+4586:         output[channel][loc] += data
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_v_channel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_loc);
    __pyx_t_3 = __pyx_v_loc;
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_6) < 0))) __PYX_ERR(0, 4586, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4587:     else:
+4588:         out = <mus_any>output
  /*else*/ {
    __pyx_t_2 = __pyx_v_output;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_out = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_2);
    __pyx_t_2 = 0;
+4589:         cclm.mus_out_any(loc, data, channel, out._ptr)
    __pyx_t_7 = __Pyx_PyInt_As_mus_long_t(__pyx_v_loc); if (unlikely((__pyx_t_7 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4589, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_channel); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4589, __pyx_L1_error)
    (void)(mus_out_any(__pyx_t_7, __pyx_v_data, __pyx_t_8, __pyx_v_out->_ptr));
  }
  __pyx_L3:;
+4590:     return data
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4591: # --------------- outa ---------------- #
+4592: cpdef outa(loc: int, data: float, output=None):
static PyObject *__pyx_pw_8pysndlib_3clm_509outa(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_outa(PyObject *__pyx_v_loc, double __pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_outa *__pyx_optional_args) {
  PyObject *__pyx_v_output = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outa", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_output = __pyx_optional_args->output;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.outa", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_509outa(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_508outa, "\n    add data to output \\in channel 0.\n    \n    :param loc: location to write to \\in samples\n    :param data: sample value\n    :param channel: channel to write to \n    :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_509outa = {"outa", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_509outa, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_508outa};
static PyObject *__pyx_pw_8pysndlib_3clm_509outa(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_data;
  PyObject *__pyx_v_output = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outa (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_data,&__pyx_n_s_output,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4592, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4592, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("outa", 0, 2, 3, 1); __PYX_ERR(0, 4592, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4592, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "outa") < 0)) __PYX_ERR(0, 4592, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_data = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_data == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4592, __pyx_L3_error)
    __pyx_v_output = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outa", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4592, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.outa", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4592, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_508outa(__pyx_self, __pyx_v_loc, __pyx_v_data, __pyx_v_output);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_508outa(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, double __pyx_v_data, PyObject *__pyx_v_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outa", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.output = __pyx_v_output;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_outa(__pyx_v_loc, __pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.outa", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__522 = PyTuple_Pack(3, __pyx_n_s_loc, __pyx_n_s_data, __pyx_n_s_output); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(0, 4592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__522);
  __Pyx_GIVEREF(__pyx_tuple__522);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4592, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_data, __pyx_n_s_float) < 0) __PYX_ERR(0, 4592, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_509outa, 0, __pyx_n_s_outa, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__523)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outa, __pyx_t_41) < 0) __PYX_ERR(0, 4592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_outa, 4592, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) __PYX_ERR(0, 4592, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_outa {
  int __pyx_n;
  PyObject *output;
};
 4593:     """
 4594:     add data to output \in channel 0.
 4595:     
 4596:     :param loc: location to write to \in samples
 4597:     :param data: sample value
 4598:     :param channel: channel to write to 
 4599:     :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file
 4600:     :return: data
 4601:     :rtype: float
 4602:     """
+4603:     if output is not None:
  __pyx_t_1 = (__pyx_v_output != Py_None);
  if (__pyx_t_1) {
/* … */
    goto __pyx_L3;
  }
+4604:         out_any(loc, data, 0, output)
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_0, __pyx_v_output, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4605:     else:
+4606:         out_any(loc, data, 0, CLM.output)
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_0, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;
+4607:     return data
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4608: # --------------- outb ---------------- #    
+4609: cpdef outb(loc: int, data: float, output=None):
static PyObject *__pyx_pw_8pysndlib_3clm_511outb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_outb(PyObject *__pyx_v_loc, double __pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_outb *__pyx_optional_args) {
  PyObject *__pyx_v_output = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outb", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_output = __pyx_optional_args->output;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.outb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_511outb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_510outb, "\n    add data to output \\in channel 1.\n    \n    :param loc: location to write to \\in samples\n    :param data: sample value\n    :param channel: channel to write to \n    :param output: output to write to. can be an appropriately shaped np.ndarray or sample2fil\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_511outb = {"outb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_511outb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_510outb};
static PyObject *__pyx_pw_8pysndlib_3clm_511outb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_data;
  PyObject *__pyx_v_output = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_data,&__pyx_n_s_output,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("outb", 0, 2, 3, 1); __PYX_ERR(0, 4609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "outb") < 0)) __PYX_ERR(0, 4609, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_data = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_data == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4609, __pyx_L3_error)
    __pyx_v_output = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outb", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4609, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.outb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4609, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_510outb(__pyx_self, __pyx_v_loc, __pyx_v_data, __pyx_v_output);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_510outb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, double __pyx_v_data, PyObject *__pyx_v_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.output = __pyx_v_output;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_outb(__pyx_v_loc, __pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.outb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_data, __pyx_n_s_float) < 0) __PYX_ERR(0, 4609, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_511outb, 0, __pyx_n_s_outb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__524)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outb, __pyx_t_40) < 0) __PYX_ERR(0, 4609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__524 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_outb, 4609, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__524)) __PYX_ERR(0, 4609, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_outb {
  int __pyx_n;
  PyObject *output;
};
 4610:     """
 4611:     add data to output \in channel 1.
 4612:     
 4613:     :param loc: location to write to \in samples
 4614:     :param data: sample value
 4615:     :param channel: channel to write to 
 4616:     :param output: output to write to. can be an appropriately shaped np.ndarray or sample2fil
 4617:     :return: data
 4618:     :rtype: float
 4619:     """
+4620:     if output is not None:
  __pyx_t_1 = (__pyx_v_output != Py_None);
  if (__pyx_t_1) {
/* … */
    goto __pyx_L3;
  }
+4621:         out_any(loc, data, 1, output)
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_1, __pyx_v_output, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4622:     else:
+4623:         out_any(loc, data, 1, CLM.output)
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_1, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;
+4624:     return data
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4625: # --------------- outc ---------------- #    
+4626: cpdef outc(loc: int, data: float, output=None):
static PyObject *__pyx_pw_8pysndlib_3clm_513outc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_outc(PyObject *__pyx_v_loc, double __pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_outc *__pyx_optional_args) {
  PyObject *__pyx_v_output = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outc", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_output = __pyx_optional_args->output;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.outc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_513outc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_512outc, "\n    add data to output \\in channel 2.\n    \n    :param loc: location to write to \\in samples\n    :param data: sample value\n    :param channel: channel to write to \n    :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_513outc = {"outc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_513outc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_512outc};
static PyObject *__pyx_pw_8pysndlib_3clm_513outc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_data;
  PyObject *__pyx_v_output = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outc (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_data,&__pyx_n_s_output,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4626, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4626, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("outc", 0, 2, 3, 1); __PYX_ERR(0, 4626, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4626, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "outc") < 0)) __PYX_ERR(0, 4626, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_data = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_data == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4626, __pyx_L3_error)
    __pyx_v_output = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outc", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4626, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.outc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4626, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_512outc(__pyx_self, __pyx_v_loc, __pyx_v_data, __pyx_v_output);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_512outc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, double __pyx_v_data, PyObject *__pyx_v_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.output = __pyx_v_output;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_outc(__pyx_v_loc, __pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.outc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4626, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_data, __pyx_n_s_float) < 0) __PYX_ERR(0, 4626, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_513outc, 0, __pyx_n_s_outc, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__525)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outc, __pyx_t_41) < 0) __PYX_ERR(0, 4626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
/* … */
  __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_outc, 4626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) __PYX_ERR(0, 4626, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_outc {
  int __pyx_n;
  PyObject *output;
};
 4627:     """
 4628:     add data to output \in channel 2.
 4629:     
 4630:     :param loc: location to write to \in samples
 4631:     :param data: sample value
 4632:     :param channel: channel to write to 
 4633:     :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file
 4634:     :return: data
 4635:     :rtype: float
 4636:     """
+4637:     if output is not None:
  __pyx_t_1 = (__pyx_v_output != Py_None);
  if (__pyx_t_1) {
/* … */
    goto __pyx_L3;
  }
+4638:         out_any(loc, data, 2, output)
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_2, __pyx_v_output, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4639:     else:
+4640:         out_any(loc, data, 2, CLM.output)
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_2, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;
+4641:     return data
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4642: # --------------- outd ---------------- #    
+4643: cpdef outd(loc: int, data: float, output=None):
static PyObject *__pyx_pw_8pysndlib_3clm_515outd(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_outd(PyObject *__pyx_v_loc, double __pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_outd *__pyx_optional_args) {
  PyObject *__pyx_v_output = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outd", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_output = __pyx_optional_args->output;
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.outd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_515outd(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_514outd, "\n    add data to output \\in channel 3.\n    \n    :param loc: location to write to \\in samples\n    :param data: sample value\n    :param channel: channel to write to \n    :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_515outd = {"outd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_515outd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_514outd};
static PyObject *__pyx_pw_8pysndlib_3clm_515outd(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_data;
  PyObject *__pyx_v_output = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outd (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_data,&__pyx_n_s_output,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4643, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4643, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("outd", 0, 2, 3, 1); __PYX_ERR(0, 4643, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4643, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "outd") < 0)) __PYX_ERR(0, 4643, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_data = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_data == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4643, __pyx_L3_error)
    __pyx_v_output = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outd", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4643, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.outd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4643, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_514outd(__pyx_self, __pyx_v_loc, __pyx_v_data, __pyx_v_output);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_514outd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, double __pyx_v_data, PyObject *__pyx_v_output) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outd", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.output = __pyx_v_output;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_outd(__pyx_v_loc, __pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.outd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4643, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_data, __pyx_n_s_float) < 0) __PYX_ERR(0, 4643, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_515outd, 0, __pyx_n_s_outd, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__526)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_40, __pyx_tuple__270);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_outd, __pyx_t_40) < 0) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__526 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_outd, 4643, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__526)) __PYX_ERR(0, 4643, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_outd {
  int __pyx_n;
  PyObject *output;
};
 4644:     """
 4645:     add data to output \in channel 3.
 4646:     
 4647:     :param loc: location to write to \in samples
 4648:     :param data: sample value
 4649:     :param channel: channel to write to 
 4650:     :param output: output to write to. can be an appropriately shaped np.ndarray or sample2file
 4651:     :return: data
 4652:     :rtype: float
 4653:     """
+4654:     if output is not None:
  __pyx_t_1 = (__pyx_v_output != Py_None);
  if (__pyx_t_1) {
/* … */
    goto __pyx_L3;
  }
+4655:         out_any(loc, data, 3, output)
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_3, __pyx_v_output, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 4656:     else:
+4657:         out_any(loc, data, 3, CLM.output)
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, __pyx_v_data, __pyx_int_3, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;
+4658:     return data
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 4659: 
 4660: # --------------- out-bank ---------------- #    
+4661: cpdef out_bank(gens, loc: int, val: float):
static PyObject *__pyx_pw_8pysndlib_3clm_517out_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_out_bank(PyObject *__pyx_v_gens, PyObject *__pyx_v_loc, double __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_bank", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysndlib.clm.out_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_517out_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_516out_bank, "\n    calls each generator \\in the gens list, passing it the argument val, then sends that output to the output channels \\in the list order (the first generator writes to outa, the second to outb, etc).\"\n\n    :param gens: gens to call\n    :param loca: location in samples to write to\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_517out_bank = {"out_bank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_517out_bank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_516out_bank};
static PyObject *__pyx_pw_8pysndlib_3clm_517out_bank(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_gens = 0;
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_val;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_bank (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gens,&__pyx_n_s_loc,&__pyx_n_s_val,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gens)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4661, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4661, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("out_bank", 1, 3, 3, 1); __PYX_ERR(0, 4661, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4661, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("out_bank", 1, 3, 3, 2); __PYX_ERR(0, 4661, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "out_bank") < 0)) __PYX_ERR(0, 4661, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_gens = values[0];
    __pyx_v_loc = ((PyObject*)values[1]);
    __pyx_v_val = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4661, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("out_bank", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4661, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.out_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4661, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_516out_bank(__pyx_self, __pyx_v_gens, __pyx_v_loc, __pyx_v_val);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_516out_bank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gens, PyObject *__pyx_v_loc, double __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("out_bank", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_out_bank(__pyx_v_gens, __pyx_v_loc, __pyx_v_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.out_bank", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__527 = PyTuple_Pack(3, __pyx_n_s_gens, __pyx_n_s_loc, __pyx_n_s_val); if (unlikely(!__pyx_tuple__527)) __PYX_ERR(0, 4661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__527);
  __Pyx_GIVEREF(__pyx_tuple__527);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4661, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_val, __pyx_n_s_float) < 0) __PYX_ERR(0, 4661, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_517out_bank, 0, __pyx_n_s_out_bank, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__528)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_out_bank, __pyx_t_41) < 0) __PYX_ERR(0, 4661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__528 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__527, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_out_bank, 4661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__528)) __PYX_ERR(0, 4661, __pyx_L1_error)
 4662:     """
 4663:     calls each generator \in the gens list, passing it the argument val, then sends that output to the output channels \in the list order (the first generator writes to outa, the second to outb, etc)."
 4664: 
 4665:     :param gens: gens to call
 4666:     :param loca: location in samples to write to
 4667:     :return: data
 4668:     :rtype: float
 4669:     """
+4670:     for i in range(len(gens)):
  __pyx_t_1 = PyObject_Length(__pyx_v_gens); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4670, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
+4671:         out_any(loc, cclm.mus_apply(<cclm.mus_any_ptr>gens[i]._ptr, val, 0.), i, CLM.output)
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gens, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CLM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_f_8pysndlib_3clm_out_any(__pyx_v_loc, mus_apply(((mus_any_ptr)__pyx_t_5), __pyx_v_val, 0.), __pyx_t_4, __pyx_t_7, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
+4672:     return val
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;
 4673: 
 4674: #--------------- in-any ----------------#
+4675: cpdef in_any(loc: int, channel: int, inp):
static PyObject *__pyx_pw_8pysndlib_3clm_519in_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_in_any(PyObject *__pyx_v_loc, PyObject *__pyx_v_channel, PyObject *__pyx_v_inp, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_ipt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("in_any", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.in_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ipt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_519in_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_518in_any, "\n    input stream sample at loc \\in channel chan.\n    \n    :param loc: location to read from\n    :param channel: channel to read from \n    :param inp: input to read from. can be an appropriately shaped np.ndarray or file2sample\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_519in_any = {"in_any", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_519in_any, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_518in_any};
static PyObject *__pyx_pw_8pysndlib_3clm_519in_any(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_inp = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("in_any (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_channel,&__pyx_n_s_inp,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4675, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channel)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4675, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("in_any", 1, 3, 3, 1); __PYX_ERR(0, 4675, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4675, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("in_any", 1, 3, 3, 2); __PYX_ERR(0, 4675, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "in_any") < 0)) __PYX_ERR(0, 4675, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_channel = ((PyObject*)values[1]);
    __pyx_v_inp = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("in_any", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4675, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.in_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4675, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_channel), (&PyInt_Type), 0, "channel", 1))) __PYX_ERR(0, 4675, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_518in_any(__pyx_self, __pyx_v_loc, __pyx_v_channel, __pyx_v_inp);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_518in_any(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_channel, PyObject *__pyx_v_inp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("in_any", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_in_any(__pyx_v_loc, __pyx_v_channel, __pyx_v_inp, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.in_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__529 = PyTuple_Pack(3, __pyx_n_s_loc, __pyx_n_s_channel, __pyx_n_s_inp); if (unlikely(!__pyx_tuple__529)) __PYX_ERR(0, 4675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__529);
  __Pyx_GIVEREF(__pyx_tuple__529);
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4675, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_channel, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4675, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_519in_any, 0, __pyx_n_s_in_any, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__530)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_in_any, __pyx_t_40) < 0) __PYX_ERR(0, 4675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__530 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__529, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_in_any, 4675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__530)) __PYX_ERR(0, 4675, __pyx_L1_error)
 4676:     """
 4677:     input stream sample at loc \in channel chan.
 4678:     
 4679:     :param loc: location to read from
 4680:     :param channel: channel to read from 
 4681:     :param inp: input to read from. can be an appropriately shaped np.ndarray or file2sample
 4682:     :return: data
 4683:     :rtype: float
 4684:     """
+4685:     if is_list_or_ndarray(input):
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_builtin_input, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
/* … */
  }
+4686:         return inp[channel][loc]
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_inp, __pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_loc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
+4687:     elif isinstance(inp, types.GeneratorType):
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_GeneratorType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_inp, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
/* … */
  }
+4688:         return next(inp)
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_inp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
+4689:     elif callable(inp):
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_inp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4689, __pyx_L1_error)
  if (__pyx_t_2) {
/* … */
  }
+4690:         return inp(loc, channel)
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_inp);
    __pyx_t_3 = __pyx_v_inp; __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_loc, __pyx_v_channel};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
 4691:     else:
+4692:         ipt = <mus_any>inp
  /*else*/ {
    __pyx_t_1 = __pyx_v_inp;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_ipt = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_1);
    __pyx_t_1 = 0;
+4693:         return cclm.mus_in_any(loc, channel, ipt._ptr)
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyInt_As_mus_long_t(__pyx_v_loc); if (unlikely((__pyx_t_6 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4693, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_channel); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4693, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(mus_in_any(__pyx_t_6, __pyx_t_5, __pyx_v_ipt->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
 4694: 
 4695: #--------------- ina ----------------#
+4696: cpdef ina(loc: int, inp):
static PyObject *__pyx_pw_8pysndlib_3clm_521ina(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_ina(PyObject *__pyx_v_loc, PyObject *__pyx_v_inp, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ina", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.ina", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_521ina(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_520ina, "\n    input stream sample at loc \\in channel 0.\n    \n    :param loc: location to read from\n    :param inp: input to read from. can be an appropriately shaped np.ndarray or file2sample\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_521ina = {"ina", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_521ina, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_520ina};
static PyObject *__pyx_pw_8pysndlib_3clm_521ina(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_v_inp = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ina (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_inp,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4696, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4696, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("ina", 1, 2, 2, 1); __PYX_ERR(0, 4696, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ina") < 0)) __PYX_ERR(0, 4696, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_inp = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ina", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4696, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.ina", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4696, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_520ina(__pyx_self, __pyx_v_loc, __pyx_v_inp);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_520ina(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_inp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ina", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_ina(__pyx_v_loc, __pyx_v_inp, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.ina", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__531 = PyTuple_Pack(2, __pyx_n_s_loc, __pyx_n_s_inp); if (unlikely(!__pyx_tuple__531)) __PYX_ERR(0, 4696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__531);
  __Pyx_GIVEREF(__pyx_tuple__531);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4696, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_521ina, 0, __pyx_n_s_ina, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__532)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ina, __pyx_t_41) < 0) __PYX_ERR(0, 4696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_codeobj__532 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__531, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_ina, 4696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__532)) __PYX_ERR(0, 4696, __pyx_L1_error)
 4697:     """
 4698:     input stream sample at loc \in channel 0.
 4699:     
 4700:     :param loc: location to read from
 4701:     :param inp: input to read from. can be an appropriately shaped np.ndarray or file2sample
 4702:     :return: data
 4703:     :rtype: float
 4704:     """
+4705:     return in_any(loc, 0, inp)
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 4705, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_in_any(__pyx_v_loc, ((PyObject*)__pyx_int_0), __pyx_v_inp, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4706: 
 4707: #--------------- inb ----------------#    
+4708: cpdef inb(loc: int, inp):
static PyObject *__pyx_pw_8pysndlib_3clm_523inb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_inb(PyObject *__pyx_v_loc, PyObject *__pyx_v_inp, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inb", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.inb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_523inb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_522inb, "\n    input stream sample at loc \\in channel 1.\n    \n    :param loc: location to read from\n    :param channel: channel to read from \n    :param inp: input to read from. can be an appropriately shaped np.ndarray or file2sample\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_523inb = {"inb", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_523inb, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_522inb};
static PyObject *__pyx_pw_8pysndlib_3clm_523inb(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_v_inp = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inb (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_inp,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4708, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4708, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("inb", 1, 2, 2, 1); __PYX_ERR(0, 4708, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "inb") < 0)) __PYX_ERR(0, 4708, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_loc = ((PyObject*)values[0]);
    __pyx_v_inp = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inb", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4708, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.inb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4708, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_522inb(__pyx_self, __pyx_v_loc, __pyx_v_inp);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_522inb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_inp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_inb(__pyx_v_loc, __pyx_v_inp, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.inb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4708, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_523inb, 0, __pyx_n_s_inb, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__533)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inb, __pyx_t_40) < 0) __PYX_ERR(0, 4708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__531, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_inb, 4708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) __PYX_ERR(0, 4708, __pyx_L1_error)
 4709:     """
 4710:     input stream sample at loc \in channel 1.
 4711:     
 4712:     :param loc: location to read from
 4713:     :param channel: channel to read from 
 4714:     :param inp: input to read from. can be an appropriately shaped np.ndarray or file2sample
 4715:     :return: data
 4716:     :rtype: float
 4717:     """
+4718:     return in_any(loc, 1, inp)
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_1))) __PYX_ERR(0, 4718, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_in_any(__pyx_v_loc, ((PyObject*)__pyx_int_1), __pyx_v_inp, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 4719: 
 4720: 
 4721: 
 4722: # --------------- locsig ---------------- #
+4723: cpdef mus_any make_locsig(degree: Optional[float]=0.0,
static PyObject *__pyx_pw_8pysndlib_3clm_525make_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_f_8pysndlib_3clm_make_locsig(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_locsig *__pyx_optional_args) {
  PyObject *__pyx_v_degree = ((PyObject *)__pyx_float_0_0);
  PyObject *__pyx_v_distance = ((PyObject *)__pyx_float_1_);
  PyObject *__pyx_v_reverb = ((PyObject *)__pyx_float_0_0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF((PyObject *)__pyx_v_rout);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_revout);
  __Pyx_XDECREF(__pyx_v_channels);
  __Pyx_XDECREF(__pyx_v_reverb_channels);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_525make_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_524make_locsig, "\n    return a new generator for signal placement \\in n channels.  channel 0 corresponds to 0 degrees.\n    \n    :param degree: degree to place sound\n    :param distance: distance, 1.0 or greater\n    :param reverb: reverb amount\n    :param output: output to write 'dry' signal to. can be an appropriately shaped np.ndarray or sample2file\n    :param revout: output to write 'wet' signal to. can be an appropriately shaped np.ndarray or sample2file\n    :param channels: number of main channels\n    :param reverb_channels: number of channels for reverb\n    :param interp_type: interpolation of position. can be Interp.LINEAR, Interp.SINUSOIDAL\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_525make_locsig = {"make_locsig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_525make_locsig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_524make_locsig};
static PyObject *__pyx_pw_8pysndlib_3clm_525make_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_degree = 0;
  PyObject *__pyx_v_distance = 0;
  PyObject *__pyx_v_reverb = 0;
  PyObject *__pyx_v_output = 0;
  PyObject *__pyx_v_revout = 0;
  PyObject *__pyx_v_channels = 0;
  PyObject *__pyx_v_reverb_channels = 0;
  PyObject *__pyx_v_interp_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_locsig (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_degree,&__pyx_n_s_distance,&__pyx_n_s_reverb,&__pyx_n_s_output,&__pyx_n_s_revout,&__pyx_n_s_channels,&__pyx_n_s_reverb_channels,&__pyx_n_s_interp_type,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_float_0_0);
    values[1] = ((PyObject *)__pyx_float_1_);
    values[2] = ((PyObject *)__pyx_float_0_0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_524make_locsig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_distance, PyObject *__pyx_v_reverb, PyObject *__pyx_v_output, PyObject *__pyx_v_revout, PyObject *__pyx_v_channels, PyObject *__pyx_v_reverb_channels, PyObject *__pyx_v_interp_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_locsig", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 8;
  __pyx_t_2.degree = __pyx_v_degree;
  __pyx_t_2.distance = __pyx_v_distance;
  __pyx_t_2.reverb = __pyx_v_reverb;
  __pyx_t_2.output = __pyx_v_output;
  __pyx_t_2.revout = __pyx_v_revout;
  __pyx_t_2.channels = __pyx_v_channels;
  __pyx_t_2.reverb_channels = __pyx_v_reverb_channels;
  __pyx_t_2.interp_type = __pyx_v_interp_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_locsig(0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__534 = PyTuple_Pack(8, __pyx_n_s_degree, __pyx_n_s_distance, __pyx_n_s_reverb, __pyx_n_s_output, __pyx_n_s_revout, __pyx_n_s_channels, __pyx_n_s_reverb_channels, __pyx_n_s_interp_type); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(0, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__534);
  __Pyx_GIVEREF(__pyx_tuple__534);
/* … */
  __pyx_t_41 = PyTuple_New(8); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_float_0_0);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyTuple_SET_ITEM(__pyx_t_41, 1, __pyx_float_1_);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_41, 2, __pyx_float_0_0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 3, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 4, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 5, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_41, 6, Py_None);
  __Pyx_GIVEREF(__pyx_t_40);
  PyTuple_SET_ITEM(__pyx_t_41, 7, __pyx_t_40);
  __pyx_t_40 = 0;
  __pyx_t_40 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_degree, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_distance, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_reverb, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_output, __pyx_kp_s_Optional_mus_any) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_revout, __pyx_kp_s_Optional_mus_any) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_channels, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_reverb_channels, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_interp_type, __pyx_kp_s_Optional_Interp) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_525make_locsig, 0, __pyx_n_s_make_locsig, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__535)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_41);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_locsig, __pyx_t_37) < 0) __PYX_ERR(0, 4723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__535 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_locsig, 4723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__535)) __PYX_ERR(0, 4723, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_locsig {
  int __pyx_n;
  PyObject *degree;
  PyObject *distance;
  PyObject *reverb;
  PyObject *output;
  PyObject *revout;
  PyObject *channels;
  PyObject *reverb_channels;
  PyObject *interp_type;
};
 4724:     distance: Optional[float]=1.,
 4725:     reverb: Optional[float]=0.0,
+4726:     output: Optional[mus_any]=None,
  PyObject *__pyx_v_output = ((PyObject *)Py_None);
/* … */
    values[3] = ((PyObject *)Py_None);
+4727:     revout: Optional[mus_any]=None,
  PyObject *__pyx_v_revout = ((PyObject *)Py_None);
/* … */
    values[4] = ((PyObject *)Py_None);
+4728:     channels: Optional[int]=None,
  PyObject *__pyx_v_channels = ((PyObject *)Py_None);
/* … */
    values[5] = ((PyObject *)Py_None);
+4729:     reverb_channels: Optional[int]=None,
  PyObject *__pyx_v_reverb_channels = ((PyObject *)Py_None);
  PyObject *__pyx_v_interp_type = __pyx_k__58;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_out = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_rout = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_res = NULL;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_locsig", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_degree = __pyx_optional_args->degree;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_distance = __pyx_optional_args->distance;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_reverb = __pyx_optional_args->reverb;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_output = __pyx_optional_args->output;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_revout = __pyx_optional_args->revout;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_channels = __pyx_optional_args->channels;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_reverb_channels = __pyx_optional_args->reverb_channels;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_interp_type = __pyx_optional_args->interp_type;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_output);
  __Pyx_INCREF(__pyx_v_revout);
  __Pyx_INCREF(__pyx_v_channels);
  __Pyx_INCREF(__pyx_v_reverb_channels);
/* … */
    values[6] = ((PyObject *)Py_None);
    values[7] = __pyx_k__58;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_degree);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_distance);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverb);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_revout);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_channels);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverb_channels);
          if (value) { values[6] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_interp_type);
          if (value) { values[7] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4723, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_locsig") < 0)) __PYX_ERR(0, 4723, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_degree = values[0];
    __pyx_v_distance = values[1];
    __pyx_v_reverb = values[2];
    __pyx_v_output = values[3];
    __pyx_v_revout = values[4];
    __pyx_v_channels = values[5];
    __pyx_v_reverb_channels = values[6];
    __pyx_v_interp_type = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_locsig", 0, 0, 8, __pyx_nargs); __PYX_ERR(0, 4723, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_524make_locsig(__pyx_self, __pyx_v_degree, __pyx_v_distance, __pyx_v_reverb, __pyx_v_output, __pyx_v_revout, __pyx_v_channels, __pyx_v_reverb_channels, __pyx_v_interp_type);
+4730:     interp_type: Optional[Interp]=Interp.LINEAR):
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_k__58 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
/* … */
  __pyx_t_40 = __Pyx_Enum_Interp_to_py(__pyx_e_8pysndlib_3clm_LINEAR); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
 4731:     
 4732:     """
 4733:     return a new generator for signal placement \in n channels.  channel 0 corresponds to 0 degrees.
 4734:     
 4735:     :param degree: degree to place sound
 4736:     :param distance: distance, 1.0 or greater
 4737:     :param reverb: reverb amount
 4738:     :param output: output to write 'dry' signal to. can be an appropriately shaped np.ndarray or sample2file
 4739:     :param revout: output to write 'wet' signal to. can be an appropriately shaped np.ndarray or sample2file
 4740:     :param channels: number of main channels
 4741:     :param reverb_channels: number of channels for reverb
 4742:     :param interp_type: interpolation of position. can be Interp.LINEAR, Interp.SINUSOIDAL
 4743:     """
 4744: 
 4745:     cdef cclm.detour_cb cy_detour_f_ptr
 4746: 
+4747:     if output is None:
  __pyx_t_1 = (__pyx_v_output == Py_None);
  if (__pyx_t_1) {
/* … */
  }
+4748:         output = CLM.output  #todo : check if this exists
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_3);
    __pyx_t_3 = 0;
 4749: 
+4750:     if revout is None:
  __pyx_t_1 = (__pyx_v_revout == Py_None);
  if (__pyx_t_1) {
/* … */
  }
+4751:         if CLM.reverb is not None:
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reverb); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {
/* … */
      goto __pyx_L5;
    }
+4752:             revout = CLM.reverb
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reverb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_revout, __pyx_t_3);
      __pyx_t_3 = 0;
 4753:         else:
+4754:             revout = None #this generates and error but still works
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_revout, Py_None);
    }
    __pyx_L5:;
 4755: 
+4756:     if channels is None:
  __pyx_t_1 = (__pyx_v_channels == Py_None);
  if (__pyx_t_1) {
/* … */
  }
+4757:         channels = clm_channels(output)
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_output};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_channels, __pyx_t_3);
    __pyx_t_3 = 0;
 4758: 
+4759:     if reverb_channels is None:
  __pyx_t_1 = (__pyx_v_reverb_channels == Py_None);
  if (__pyx_t_1) {
/* … */
  }
+4760:         if revout is None:
    __pyx_t_1 = (__pyx_v_revout == Py_None);
    if (__pyx_t_1) {
/* … */
      goto __pyx_L8;
    }
+4761:             reverb_channels = 0
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_DECREF_SET(__pyx_v_reverb_channels, __pyx_int_0);
 4762:         else:
+4763:             reverb_channels = clm_channels(revout)
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_5 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_revout};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF_SET(__pyx_v_reverb_channels, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L8:;
 4764: 
+4765:     if isinstance(output, mus_any):
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_output, __pyx_ptype_8pysndlib_3clm_mus_any); 
  if (__pyx_t_1) {
/* … */
  }
 4766: 
+4767:         out = <mus_any>output
    __pyx_t_3 = __pyx_v_output;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_out = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
    __pyx_t_3 = 0;
+4768:         rout = <mus_any>revout
    __pyx_t_3 = __pyx_v_revout;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_rout = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
    __pyx_t_3 = 0;
+4769:         if revout is not None:
    __pyx_t_1 = (__pyx_v_revout != Py_None);
    if (__pyx_t_1) {
/* … */
      goto __pyx_L10;
    }
+4770:             res = mus_any.from_ptr(cclm.mus_make_locsig(degree, distance, reverb, channels, out._ptr, reverb_channels, rout._ptr,  interp_type))
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_degree); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L1_error)
      __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_distance); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L1_error)
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_reverb); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_reverb_channels); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L1_error)
      __pyx_t_10 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4770, __pyx_L1_error)
      __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_locsig(__pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_v_out->_ptr, __pyx_t_9, __pyx_v_rout->_ptr, __pyx_t_10), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
      __pyx_t_3 = 0;
 4771:         else:
+4772:             res = mus_any.from_ptr(cclm.mus_make_locsig(degree, distance, reverb, channels, out._ptr, reverb_channels, NULL ,  interp_type))
    /*else*/ {
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_degree); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4772, __pyx_L1_error)
      __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_distance); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4772, __pyx_L1_error)
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_reverb); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4772, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4772, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_reverb_channels); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4772, __pyx_L1_error)
      __pyx_t_10 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4772, __pyx_L1_error)
      __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_locsig(__pyx_t_8, __pyx_t_7, __pyx_t_6, __pyx_t_9, __pyx_v_out->_ptr, __pyx_t_5, NULL, __pyx_t_10), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L10:;
+4773:         return res
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;
 4774: 
 4775:     # todo: what if revout is not an iterable? while possible not going to deal with it right now :)   
+4776:     elif is_list_or_ndarray(output):
  __pyx_t_3 = __pyx_f_8pysndlib_3clm_is_list_or_ndarray(__pyx_v_output, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 4776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(__pyx_t_1)) {
/* … */
  }
+4777:         if reverb_channels is None:
    __pyx_t_1 = (__pyx_v_reverb_channels == Py_None);
    if (__pyx_t_1) {
/* … */
    }
+4778:             reverb_channels = 0
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_DECREF_SET(__pyx_v_reverb_channels, __pyx_int_0);
 4779: 
+4780:         res = mus_any.from_ptr(cclm.mus_make_locsig(degree, distance, reverb, channels, NULL, reverb_channels, NULL, interp_type))
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_degree); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4780, __pyx_L1_error)
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_distance); if (unlikely((__pyx_t_7 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4780, __pyx_L1_error)
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_reverb); if (unlikely((__pyx_t_8 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4780, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4780, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_reverb_channels); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4780, __pyx_L1_error)
    __pyx_t_10 = ((mus_interp_t)__Pyx_PyInt_As_mus_interp_t(__pyx_v_interp_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4780, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_vtabptr_8pysndlib_3clm_mus_any->from_ptr(mus_make_locsig(__pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_5, NULL, __pyx_t_9, NULL, __pyx_t_10), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_res = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_3);
    __pyx_t_3 = 0;
+4781:         cclm.mus_locsig_set_detour(res._ptr, <cclm.detour_cb>locsig_detour_callback_func)
    mus_locsig_set_detour(__pyx_v_res->_ptr, ((detour_cb)__pyx_f_8pysndlib_3clm_locsig_detour_callback_func));
 4782: 
+4783:         return res
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;
 4784: 
 4785:     else:
+4786:         raise TypeError(f"output needs to be a clm gen or np.array not a {type(output)}")
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_output)), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_output_needs_to_be_a_clm_gen_or, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4786, __pyx_L1_error)
  }
 4787: 
+4788: cpdef cython.double locsig(gen: mus_any, loc: int, val: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_527locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_locsig(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_loc, double __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_527locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_526locsig, "\n    locsig 'gen' channel 'chan' scaler.\n    \n    :param gen: locsig gen\n    :param loc: location to write to \\in samples\n    :param val: sample value\n    :return: data\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_527locsig = {"locsig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_527locsig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_526locsig};
static PyObject *__pyx_pw_8pysndlib_3clm_527locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_loc = 0;
  double __pyx_v_val;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_loc,&__pyx_n_s_val,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4788, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loc)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4788, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig", 1, 3, 3, 1); __PYX_ERR(0, 4788, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4788, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig", 1, 3, 3, 2); __PYX_ERR(0, 4788, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "locsig") < 0)) __PYX_ERR(0, 4788, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_loc = ((PyObject*)values[1]);
    __pyx_v_val = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4788, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("locsig", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4788, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4788, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loc), (&PyInt_Type), 0, "loc", 1))) __PYX_ERR(0, 4788, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_526locsig(__pyx_self, __pyx_v_gen, __pyx_v_loc, __pyx_v_val);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_526locsig(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_loc, double __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_locsig(__pyx_v_gen, __pyx_v_loc, __pyx_v_val, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4788, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__536 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_loc, __pyx_n_s_val); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(0, 4788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__536);
  __Pyx_GIVEREF(__pyx_tuple__536);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4788, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_loc, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4788, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_val, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 4788, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_527locsig, 0, __pyx_n_s_locsig, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__537)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_locsig, __pyx_t_40) < 0) __PYX_ERR(0, 4788, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__537 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_locsig, 4788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__537)) __PYX_ERR(0, 4788, __pyx_L1_error)
 4789:     """
 4790:     locsig 'gen' channel 'chan' scaler.
 4791:     
 4792:     :param gen: locsig gen
 4793:     :param loc: location to write to \in samples
 4794:     :param val: sample value
 4795:     :return: data
 4796:     :rtype: float
 4797:     """
+4798:     cclm.mus_locsig(gen._ptr, loc, val)
  __pyx_t_1 = __Pyx_PyInt_As_mus_long_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == ((mus_long_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4798, __pyx_L1_error)
  mus_locsig(__pyx_v_gen->_ptr, __pyx_t_1, __pyx_v_val);
 4799: 
+4800: cpdef bint is_locsig(gen: mus_any):
static PyObject *__pyx_pw_8pysndlib_3clm_529is_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_8pysndlib_3clm_is_locsig(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_locsig", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_529is_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_528is_locsig, "\n    returns True if gen is a locsig.\n    \n    :param gen: gen\n    :return: result\n    :rtype: bool\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_529is_locsig = {"is_locsig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_529is_locsig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_528is_locsig};
static PyObject *__pyx_pw_8pysndlib_3clm_529is_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_locsig (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4800, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_locsig") < 0)) __PYX_ERR(0, 4800, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_locsig", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4800, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4800, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_528is_locsig(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_528is_locsig(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_locsig", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_locsig(__pyx_v_gen, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4800, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4800, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_529is_locsig, 0, __pyx_n_s_is_locsig, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__538)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_locsig, __pyx_t_37) < 0) __PYX_ERR(0, 4800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__538 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_locsig, 4800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__538)) __PYX_ERR(0, 4800, __pyx_L1_error)
 4801:     """
 4802:     returns True if gen is a locsig.
 4803:     
 4804:     :param gen: gen
 4805:     :return: result
 4806:     :rtype: bool
 4807:     """
+4808:     return cclm.mus_is_locsig(gen._ptr)
  __pyx_r = mus_is_locsig(__pyx_v_gen->_ptr);
  goto __pyx_L0;
 4809: 
+4810: cpdef cython.double locsig_ref(gen: mus_any, chan: int):
static PyObject *__pyx_pw_8pysndlib_3clm_531locsig_ref(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_locsig_ref(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_ref", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_531locsig_ref(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_530locsig_ref, "\n    get locsig 'gen' channel 'chan' scaler for main output.\n    \n    :param gen: locsig gen\n    :param chan: channel to get\n    :return: scaler of chan\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_531locsig_ref = {"locsig_ref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_531locsig_ref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_530locsig_ref};
static PyObject *__pyx_pw_8pysndlib_3clm_531locsig_ref(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_chan = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_ref (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_chan,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4810, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4810, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig_ref", 1, 2, 2, 1); __PYX_ERR(0, 4810, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "locsig_ref") < 0)) __PYX_ERR(0, 4810, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_chan = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("locsig_ref", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4810, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4810, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chan), (&PyInt_Type), 0, "chan", 1))) __PYX_ERR(0, 4810, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_530locsig_ref(__pyx_self, __pyx_v_gen, __pyx_v_chan);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_530locsig_ref(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_ref", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_locsig_ref(__pyx_v_gen, __pyx_v_chan, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4810, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.locsig_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__539 = PyTuple_Pack(2, __pyx_n_s_gen, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__539)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__539);
  __Pyx_GIVEREF(__pyx_tuple__539);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_chan, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4810, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_531locsig_ref, 0, __pyx_n_s_locsig_ref, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__540)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_locsig_ref, __pyx_t_40) < 0) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__540 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__539, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_locsig_ref, 4810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__540)) __PYX_ERR(0, 4810, __pyx_L1_error)
 4811:     """
 4812:     get locsig 'gen' channel 'chan' scaler for main output.
 4813:     
 4814:     :param gen: locsig gen
 4815:     :param chan: channel to get
 4816:     :return: scaler of chan
 4817:     :rtype: float
 4818:     """
+4819:     return cclm.mus_locsig_ref(gen._ptr, chan)
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4819, __pyx_L1_error)
  __pyx_r = mus_locsig_ref(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 4820: 
+4821: cpdef cython.double locsig_set(gen: mus_any, chan: int, val: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_533locsig_set(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_locsig_set(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan, double __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_set", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_533locsig_set(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_532locsig_set, "\n    set the locsig generator's channel 'chan' scaler to 'val'  for main output.\n    \n    :param gen: locsig gen\n    :param chan: channel to set\n    :param val: value to set to\n    :return: scaler of chan\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_533locsig_set = {"locsig_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_533locsig_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_532locsig_set};
static PyObject *__pyx_pw_8pysndlib_3clm_533locsig_set(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_chan = 0;
  double __pyx_v_val;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_set (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_chan,&__pyx_n_s_val,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4821, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4821, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig_set", 1, 3, 3, 1); __PYX_ERR(0, 4821, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4821, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig_set", 1, 3, 3, 2); __PYX_ERR(0, 4821, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "locsig_set") < 0)) __PYX_ERR(0, 4821, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_chan = ((PyObject*)values[1]);
    __pyx_v_val = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4821, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("locsig_set", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4821, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4821, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chan), (&PyInt_Type), 0, "chan", 1))) __PYX_ERR(0, 4821, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_532locsig_set(__pyx_self, __pyx_v_gen, __pyx_v_chan, __pyx_v_val);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_532locsig_set(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan, double __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_locsig_set(__pyx_v_gen, __pyx_v_chan, __pyx_v_val, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4821, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.locsig_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__541 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_chan, __pyx_n_s_val); if (unlikely(!__pyx_tuple__541)) __PYX_ERR(0, 4821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__541);
  __Pyx_GIVEREF(__pyx_tuple__541);
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4821, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_chan, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4821, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_val, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 4821, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_533locsig_set, 0, __pyx_n_s_locsig_set, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__542)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_locsig_set, __pyx_t_37) < 0) __PYX_ERR(0, 4821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__542 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__541, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_locsig_set, 4821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__542)) __PYX_ERR(0, 4821, __pyx_L1_error)
 4822:     """
 4823:     set the locsig generator's channel 'chan' scaler to 'val'  for main output.
 4824:     
 4825:     :param gen: locsig gen
 4826:     :param chan: channel to set
 4827:     :param val: value to set to
 4828:     :return: scaler of chan
 4829:     :rtype: float
 4830:     """
+4831:     return cclm.mus_locsig_set(gen._ptr, chan, val)
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4831, __pyx_L1_error)
  __pyx_r = mus_locsig_set(__pyx_v_gen->_ptr, __pyx_t_1, __pyx_v_val);
  goto __pyx_L0;
 4832: 
+4833: cpdef cython.double locsig_reverb_ref(gen: mus_any, chan: int):
static PyObject *__pyx_pw_8pysndlib_3clm_535locsig_reverb_ref(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_locsig_reverb_ref(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_reverb_ref", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_reverb_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_535locsig_reverb_ref(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_534locsig_reverb_ref, "\n    get locsig reverb channel 'chan' scaler.\n    \n    :param gen: locsig gen\n    :param chan: channel to get\n    :return: scaler of chan\n    :rtype: float\n    \n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_535locsig_reverb_ref = {"locsig_reverb_ref", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_535locsig_reverb_ref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_534locsig_reverb_ref};
static PyObject *__pyx_pw_8pysndlib_3clm_535locsig_reverb_ref(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_chan = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_reverb_ref (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_chan,0};
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4833, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4833, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig_reverb_ref", 1, 2, 2, 1); __PYX_ERR(0, 4833, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "locsig_reverb_ref") < 0)) __PYX_ERR(0, 4833, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_chan = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("locsig_reverb_ref", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4833, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_reverb_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4833, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chan), (&PyInt_Type), 0, "chan", 1))) __PYX_ERR(0, 4833, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_534locsig_reverb_ref(__pyx_self, __pyx_v_gen, __pyx_v_chan);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_534locsig_reverb_ref(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_reverb_ref", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_locsig_reverb_ref(__pyx_v_gen, __pyx_v_chan, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4833, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.locsig_reverb_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4833, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_chan, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4833, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_535locsig_reverb_ref, 0, __pyx_n_s_locsig_reverb_ref, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__543)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_locsig_reverb_ref, __pyx_t_40) < 0) __PYX_ERR(0, 4833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
/* … */
  __pyx_codeobj__543 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__539, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_locsig_reverb_ref, 4833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__543)) __PYX_ERR(0, 4833, __pyx_L1_error)
 4834:     """
 4835:     get locsig reverb channel 'chan' scaler.
 4836:     
 4837:     :param gen: locsig gen
 4838:     :param chan: channel to get
 4839:     :return: scaler of chan
 4840:     :rtype: float
 4841:     
 4842:     """
+4843:     return cclm.mus_locsig_reverb_ref(gen._ptr, chan)
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4843, __pyx_L1_error)
  __pyx_r = mus_locsig_reverb_ref(__pyx_v_gen->_ptr, __pyx_t_1);
  goto __pyx_L0;
 4844: 
+4845: cpdef cython.double locsig_reverb_set(gen: mus_any, chan: int, val: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_537locsig_reverb_set(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static double __pyx_f_8pysndlib_3clm_locsig_reverb_set(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan, double __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_reverb_set", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_reverb_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_537locsig_reverb_set(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_536locsig_reverb_set, "\n    set the locsig reverb channel 'chan' scaler to 'val'.\n    \n    :param gen: locsig gen\n    :param chan: channel to set\n    :param val: value to set to\n    :return: scaler of chan\n    :rtype: float\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_537locsig_reverb_set = {"locsig_reverb_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_537locsig_reverb_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_536locsig_reverb_set};
static PyObject *__pyx_pw_8pysndlib_3clm_537locsig_reverb_set(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  PyObject *__pyx_v_chan = 0;
  double __pyx_v_val;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_reverb_set (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_chan,&__pyx_n_s_val,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4845, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4845, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig_reverb_set", 1, 3, 3, 1); __PYX_ERR(0, 4845, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_val)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4845, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("locsig_reverb_set", 1, 3, 3, 2); __PYX_ERR(0, 4845, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "locsig_reverb_set") < 0)) __PYX_ERR(0, 4845, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_chan = ((PyObject*)values[1]);
    __pyx_v_val = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_val == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4845, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("locsig_reverb_set", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4845, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.locsig_reverb_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4845, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chan), (&PyInt_Type), 0, "chan", 1))) __PYX_ERR(0, 4845, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_536locsig_reverb_set(__pyx_self, __pyx_v_gen, __pyx_v_chan, __pyx_v_val);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_536locsig_reverb_set(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, PyObject *__pyx_v_chan, double __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("locsig_reverb_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_locsig_reverb_set(__pyx_v_gen, __pyx_v_chan, __pyx_v_val, 0); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4845, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.locsig_reverb_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_40 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4845, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_chan, __pyx_n_s_int_2) < 0) __PYX_ERR(0, 4845, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_40, __pyx_n_s_val, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 4845, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_537locsig_reverb_set, 0, __pyx_n_s_locsig_reverb_set, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__544)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_40);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_locsig_reverb_set, __pyx_t_37) < 0) __PYX_ERR(0, 4845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__544 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__541, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_locsig_reverb_set, 4845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__544)) __PYX_ERR(0, 4845, __pyx_L1_error)
 4846:     """
 4847:     set the locsig reverb channel 'chan' scaler to 'val'.
 4848:     
 4849:     :param gen: locsig gen
 4850:     :param chan: channel to set
 4851:     :param val: value to set to
 4852:     :return: scaler of chan
 4853:     :rtype: float
 4854:     """
+4855:     return cclm.mus_locsig_reverb_set(gen._ptr, chan, val)
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4855, __pyx_L1_error)
  __pyx_r = mus_locsig_reverb_set(__pyx_v_gen->_ptr, __pyx_t_1, __pyx_v_val);
  goto __pyx_L0;
 4856: 
+4857: cpdef void move_locsig(gen: mus_any, degree: cython.double, distance: cython.double):
static PyObject *__pyx_pw_8pysndlib_3clm_539move_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_8pysndlib_3clm_move_locsig(struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_degree, double __pyx_v_distance, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("move_locsig", 0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_539move_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_538move_locsig, "\n    move locsig gen to reflect degree and distance.\n    \n    :param gen: locsig gen\n    :param degree: new degree\n    :param distance: new distance\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_539move_locsig = {"move_locsig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_539move_locsig, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_538move_locsig};
static PyObject *__pyx_pw_8pysndlib_3clm_539move_locsig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen = 0;
  double __pyx_v_degree;
  double __pyx_v_distance;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("move_locsig (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,&__pyx_n_s_degree,&__pyx_n_s_distance,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4857, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_degree)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4857, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("move_locsig", 1, 3, 3, 1); __PYX_ERR(0, 4857, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_distance)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4857, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("move_locsig", 1, 3, 3, 2); __PYX_ERR(0, 4857, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "move_locsig") < 0)) __PYX_ERR(0, 4857, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)values[0]);
    __pyx_v_degree = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_degree == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4857, __pyx_L3_error)
    __pyx_v_distance = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_distance == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4857, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("move_locsig", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4857, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.move_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_mus_any, 0, "gen", 0))) __PYX_ERR(0, 4857, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_538move_locsig(__pyx_self, __pyx_v_gen, __pyx_v_degree, __pyx_v_distance);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_538move_locsig(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_gen, double __pyx_v_degree, double __pyx_v_distance) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("move_locsig", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_8pysndlib_3clm_move_locsig(__pyx_v_gen, __pyx_v_degree, __pyx_v_distance, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4857, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.move_locsig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__545 = PyTuple_Pack(3, __pyx_n_s_gen, __pyx_n_s_degree, __pyx_n_s_distance); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(0, 4857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__545);
  __Pyx_GIVEREF(__pyx_tuple__545);
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_gen, __pyx_n_s_mus_any) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_degree, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_distance, __pyx_kp_s_cython_double) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  __pyx_t_40 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_539move_locsig, 0, __pyx_n_s_move_locsig, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__546)); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_40, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_move_locsig, __pyx_t_40) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_codeobj__546 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__545, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_move_locsig, 4857, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__546)) __PYX_ERR(0, 4857, __pyx_L1_error)
 4858:     """
 4859:     move locsig gen to reflect degree and distance.
 4860:     
 4861:     :param gen: locsig gen
 4862:     :param degree: new degree
 4863:     :param distance: new distance
 4864:     """
+4865:     cclm.mus_move_locsig(gen._ptr, degree, distance)
  mus_move_locsig(__pyx_v_gen->_ptr, __pyx_v_degree, __pyx_v_distance);
 4866: 
 4867: 
 4868: # added some options . todo: what about sample rate conversion    
+4869: cpdef convolve_files(file1: str, file2: str, maxamp: Optional[float]=1., outputfile='test.aif', sample_type=CLM.sample_type, header_type=CLM.header_type):
static PyObject *__pyx_pw_8pysndlib_3clm_541convolve_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_convolve_files(PyObject *__pyx_v_file1, PyObject *__pyx_v_file2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_convolve_files *__pyx_optional_args) {
  PyObject *__pyx_v_maxamp = ((PyObject *)__pyx_float_1_);
  PyObject *__pyx_v_outputfile = ((PyObject *)__pyx_kp_s_test_aif);
  PyObject *__pyx_v_sample_type = __pyx_k__59;
  PyObject *__pyx_v_header_type = __pyx_k__60;
  PyObject *__pyx_v_temp_file = NULL;
  mus_long_t __pyx_v_length;
  struct __pyx_obj_8pysndlib_3clm_mus_any *__pyx_v_reader = NULL;
  mus_long_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolve_files", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_maxamp = __pyx_optional_args->maxamp;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_outputfile = __pyx_optional_args->outputfile;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_sample_type = __pyx_optional_args->sample_type;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_header_type = __pyx_optional_args->header_type;
          }
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pysndlib.clm.convolve_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_temp_file);
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_541convolve_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8pysndlib_3clm_540convolve_files, "\n    convolve-files handles a very common special case: convolve two files, then normalize the result to some maxamp.\n    \n    :param file1: first file\n    :param file2: second file\n    :param maxamp: amp to scale to\n    :param outputfile: output file\n    :param sample_type: type of sample type to use. defaults to clm.sample_type\n    :param header_type: header of sample type to use. defaults to clm.header_type\n    :return: output file \n    :rtype: str\n    ");
static PyMethodDef __pyx_mdef_8pysndlib_3clm_541convolve_files = {"convolve_files", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_541convolve_files, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pysndlib_3clm_540convolve_files};
static PyObject *__pyx_pw_8pysndlib_3clm_541convolve_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file1 = 0;
  PyObject *__pyx_v_file2 = 0;
  PyObject *__pyx_v_maxamp = 0;
  PyObject *__pyx_v_outputfile = 0;
  PyObject *__pyx_v_sample_type = 0;
  PyObject *__pyx_v_header_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolve_files (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file1,&__pyx_n_s_file2,&__pyx_n_s_maxamp_3,&__pyx_n_s_outputfile,&__pyx_n_s_sample_type,&__pyx_n_s_header_type,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_float_1_);
    values[3] = ((PyObject *)__pyx_kp_s_test_aif);
    values[4] = __pyx_k__59;
    values[5] = __pyx_k__60;
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file1)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4869, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file2)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4869, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("convolve_files", 0, 2, 6, 1); __PYX_ERR(0, 4869, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxamp_3);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4869, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_outputfile);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4869, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sample_type);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4869, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_type);
          if (value) { values[5] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4869, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convolve_files") < 0)) __PYX_ERR(0, 4869, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file1 = ((PyObject*)values[0]);
    __pyx_v_file2 = ((PyObject*)values[1]);
    __pyx_v_maxamp = values[2];
    __pyx_v_outputfile = values[3];
    __pyx_v_sample_type = values[4];
    __pyx_v_header_type = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convolve_files", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 4869, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.convolve_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file1), (&PyString_Type), 0, "file1", 1))) __PYX_ERR(0, 4869, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file2), (&PyString_Type), 0, "file2", 1))) __PYX_ERR(0, 4869, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_540convolve_files(__pyx_self, __pyx_v_file1, __pyx_v_file2, __pyx_v_maxamp, __pyx_v_outputfile, __pyx_v_sample_type, __pyx_v_header_type);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_540convolve_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file1, PyObject *__pyx_v_file2, PyObject *__pyx_v_maxamp, PyObject *__pyx_v_outputfile, PyObject *__pyx_v_sample_type, PyObject *__pyx_v_header_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convolve_files", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.maxamp = __pyx_v_maxamp;
  __pyx_t_2.outputfile = __pyx_v_outputfile;
  __pyx_t_2.sample_type = __pyx_v_sample_type;
  __pyx_t_2.header_type = __pyx_v_header_type;
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_convolve_files(__pyx_v_file1, __pyx_v_file2, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.convolve_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_CLM); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_k__59 = __pyx_t_37;
  __Pyx_GIVEREF(__pyx_t_37);
  __pyx_t_37 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_37, __pyx_n_s_CLM); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_header_type); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_k__60 = __pyx_t_40;
  __Pyx_GIVEREF(__pyx_t_40);
  __pyx_t_40 = 0;
/* … */
  __pyx_tuple__547 = PyTuple_Pack(6, __pyx_n_s_file1, __pyx_n_s_file2, __pyx_n_s_maxamp_3, __pyx_n_s_outputfile, __pyx_n_s_sample_type, __pyx_n_s_header_type); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__547);
  __Pyx_GIVEREF(__pyx_tuple__547);
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_CLM); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_sample_type); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_40, __pyx_n_s_CLM); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_header_type); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __pyx_t_40 = PyTuple_New(4); if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_40);
  __Pyx_INCREF(__pyx_float_1_);
  __Pyx_GIVEREF(__pyx_float_1_);
  PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_float_1_);
  __Pyx_INCREF(__pyx_kp_s_test_aif);
  __Pyx_GIVEREF(__pyx_kp_s_test_aif);
  PyTuple_SET_ITEM(__pyx_t_40, 1, __pyx_kp_s_test_aif);
  __Pyx_GIVEREF(__pyx_t_37);
  PyTuple_SET_ITEM(__pyx_t_40, 2, __pyx_t_37);
  __Pyx_GIVEREF(__pyx_t_41);
  PyTuple_SET_ITEM(__pyx_t_40, 3, __pyx_t_41);
  __pyx_t_37 = 0;
  __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_file1, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 4869, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_file2, __pyx_n_s_str_2) < 0) __PYX_ERR(0, 4869, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_maxamp_3, __pyx_kp_s_Optional_float) < 0) __PYX_ERR(0, 4869, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_541convolve_files, 0, __pyx_n_s_convolve_files, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__548)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_t_40);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convolve_files, __pyx_t_37) < 0) __PYX_ERR(0, 4869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__548 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__547, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_convolve_files, 4869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__548)) __PYX_ERR(0, 4869, __pyx_L1_error)
/* … */
struct __pyx_opt_args_8pysndlib_3clm_convolve_files {
  int __pyx_n;
  PyObject *maxamp;
  PyObject *outputfile;
  PyObject *sample_type;
  PyObject *header_type;
};
 4870:     """
 4871:     convolve-files handles a very common special case: convolve two files, then normalize the result to some maxamp.
 4872:     
 4873:     :param file1: first file
 4874:     :param file2: second file
 4875:     :param maxamp: amp to scale to
 4876:     :param outputfile: output file
 4877:     :param sample_type: type of sample type to use. defaults to clm.sample_type
 4878:     :param header_type: header of sample type to use. defaults to clm.header_type
 4879:     :return: output file 
 4880:     :rtype: str
 4881:     """
+4882:     if header_type == Header.NEXT:
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_header_type, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 4882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
/* … */
    goto __pyx_L3;
  }
+4883:         cclm.mus_convolve_files(file1, file2, maxamp,outputfile)
    __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_file1); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 4883, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_file2); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4883, __pyx_L1_error)
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_maxamp); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4883, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_outputfile); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 4883, __pyx_L1_error)
    mus_convolve_files(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7);
 4884:     else:
+4885:         temp_file = tempfile.gettempdir() + '/' + 'temp-' + outputfile
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tempfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_gettempdir); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[1] = {__pyx_t_2, };
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__61); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_temp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Add(__pyx_t_1, __pyx_v_outputfile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_temp_file = __pyx_t_8;
    __pyx_t_8 = 0;
+4886:         cclm.mus_convolve_files(file1, file2, maxamp, temp_file)
    __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_file1); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 4886, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_file2); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 4886, __pyx_L1_error)
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_maxamp); if (unlikely((__pyx_t_6 == ((mus_float_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4886, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_temp_file); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 4886, __pyx_L1_error)
    mus_convolve_files(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7);
+4887:         with Sound(outputfile, header_type=header_type, sample_type=sample_type):
    /*with:*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Sound); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_outputfile);
      __Pyx_GIVEREF(__pyx_v_outputfile);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_outputfile);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_header_type, __pyx_v_header_type) < 0) __PYX_ERR(0, 4887, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sample_type, __pyx_v_sample_type) < 0) __PYX_ERR(0, 4887, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4887, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_9 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[1] = {__pyx_t_8, };
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4887, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      /*try:*/ {
        {
          /*try:*/ {
/* … */
          }
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("pysndlib.clm.convolve_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_10, &__pyx_t_1) < 0) __PYX_ERR(0, 4887, __pyx_L10_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_1);
            __pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4887, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 4887, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            if (__pyx_t_3 < 0) __PYX_ERR(0, 4887, __pyx_L10_except_error)
            __pyx_t_21 = (!__pyx_t_3);
            if (unlikely(__pyx_t_21)) {
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_10);
              __Pyx_XGIVEREF(__pyx_t_1);
              __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_10, __pyx_t_1);
              __pyx_t_2 = 0; __pyx_t_10 = 0; __pyx_t_1 = 0; 
              __PYX_ERR(0, 4887, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_11) {
            __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__62, NULL);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4887, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }
  }
  __pyx_L3:;
/* … */
  __pyx_tuple__62 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
+4888:             length = seconds2samples(csndlib.mus_sound_duration(temp_file))
            __pyx_t_15 = __Pyx_PyObject_AsString(__pyx_v_temp_file); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 4888, __pyx_L8_error)
            __pyx_t_16 = __pyx_f_8pysndlib_3clm_seconds2samples(mus_sound_duration(__pyx_t_15), 0); if (unlikely(__pyx_t_16 == ((mus_long_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4888, __pyx_L8_error)
            __pyx_v_length = __pyx_t_16;
+4889:             reader = make_readin(temp_file)
            if (!(likely(PyString_CheckExact(__pyx_v_temp_file))||((__pyx_v_temp_file) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_temp_file))) __PYX_ERR(0, 4889, __pyx_L8_error)
            __pyx_t_10 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_readin(((PyObject*)__pyx_v_temp_file), 0, NULL)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4889, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_v_reader = ((struct __pyx_obj_8pysndlib_3clm_mus_any *)__pyx_t_10);
            __pyx_t_10 = 0;
+4890:             for i in range(0, length):
            __pyx_t_16 = __pyx_v_length;
            __pyx_t_17 = __pyx_t_16;
            for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
              __pyx_v_i = __pyx_t_18;
+4891:                 outa(i, readin(reader))
              __pyx_t_10 = __Pyx_PyInt_From_mus_long_t(__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4891, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_10);
              if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_10)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_10))) __PYX_ERR(0, 4891, __pyx_L8_error)
              __pyx_t_19 = __pyx_f_8pysndlib_3clm_readin(__pyx_v_reader, 0); if (unlikely(__pyx_t_19 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4891, __pyx_L8_error)
              __pyx_t_2 = __pyx_f_8pysndlib_3clm_outa(((PyObject*)__pyx_t_10), __pyx_t_19, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4891, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
+4892:     return outputfile
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_outputfile);
  __pyx_r = __pyx_v_outputfile;
  goto __pyx_L0;
 4893: 
 4894: 
 4895: #########################################
 4896: # basic file reading/writing to/from nympy arrays
 4897: # note all of this assumes numpy dtype is np.double
 4898: # also assumes shape is (chan, length)
 4899: # a mono file that is 8000 samples long should
 4900: # be a numpy array created with something like
 4901: # arr = np.zeroes((1,8000), dtype=np.double)
 4902: # librosa follows this convention
 4903: #  todo : look at allowing something like np.zeroes((8000), dtype=np.double)
 4904: # to just be treated as mono sound buffer 
 4905: # the python soundfile library does this differently 
 4906: # and would use 
 4907: # arr = np.zeros((8000,1), dtype=np.double))
 4908: # this seems less intuitive to me 
 4909: # very issue to translate with simple np.transpose()
 4910: 
 4911: 
 4912: # cpdef sndinfo(filename):
 4913: #     """returns a dictionary of info about a sound file including write date (data), sample rate (srate),
 4914: #     channels (chans), length in samples (samples), length in second (length), comment (comment), and loop information (loopinfo)"""
 4915: #     date = csndlib.mus_sound_write_date(filename)
 4916: #     srate = csndlib.mus_sound_srate(filename)
 4917: #     chans = csndlib.mus_sound_chans(filename)
 4918: #     samples = csndlib.mus_sound_samples(filename)
 4919: #     comment = csndlib.mus_sound_comment(filename) 
 4920: #     length = samples / (chans * srate)
 4921: # 
 4922: #     header_type = header(mus_sound_header_type(filename))
 4923: #     sample_type = sample(mus_sound_sample_type(filename))
 4924: #     
 4925: #     loop_info = mus_sound_loop_info(filename)
 4926: #     if loop_info:
 4927: #         loop_modes = [loop_info[6], loop_info[7]]
 4928: #         loop_starts = [loop_info[0], loop_info[2]]
 4929: #         loop_ends = [loop_info[1], loop_info[3]]
 4930: #         base_note = loop_info[4]
 4931: #         base_detune = loop_info[5]
 4932: #     
 4933: #         loop_info = {'sustain_start' : loop_starts[0], 'sustain_end' : loop_ends[0], 
 4934: #                     'release_start' : loop_starts[2], 'release_end' : loop_ends[1],
 4935: #                     'base_note' : base_note, 'base_detune' : base_detune, 
 4936: #                     'sustain_mode' : loop_modes[0], 'release_mode' : loop_modes[1]}
 4937: #     
 4938: #     info = {'date' : time.localtime(date), 'srate' : srate, 'chans' : chans, 'samples' : samples,
 4939: #             'comment' : comment, 'length' : length, 'header_type' : header_type, 'sample_type' : sample_type,
 4940: #             'loop_info' : loop_info}
 4941: #     return info
 4942: 
 4943: # def sound_loop_info(filename):
 4944: #     """returns a dictionary of info about a sound file including write date (data), sample rate (srate),
 4945: #     channels (chans), length in samples (samples), length in second (length), comment (comment), and loop information (loopinfo)"""
 4946: #     
 4947: #     loop_info = sndlib.mus_sound_loop_info(filename)
 4948: #     if loop_info:
 4949: #         loop_modes = [loop_info[6], loop_info[7]]
 4950: #         loop_starts = [loop_info[0], loop_info[2]]
 4951: #         loop_ends = [loop_info[1], loop_info[3]]
 4952: #         base_note = loop_info[4]
 4953: #         base_detune = loop_info[5]
 4954: #     
 4955: #         loop_info = {'sustain_start' : loop_starts[0], 'sustain_end' : loop_ends[0], 
 4956: #                     'release_start' : loop_starts[2], 'release_end' : loop_ends[1],
 4957: #                     'base_note' : base_note, 'base_detune' : base_detune, 
 4958: #                     'sustain_mode' : loop_modes[0], 'release_mode' : loop_modes[1]}
 4959: #     return info
 4960: #     
 4961: # cpdef np.ndarray file2array(filename: str, channel: Optional[int]=0, beg: Optional[int]=None, dur: Optional[int]=None):
 4962: #     """
 4963: #     return an ndarray with samples from file
 4964: #     """
 4965: #     length = dur or csndlib.mus_sound_framples(filename)
 4966: #     chans = csndlib.mus_sound_chans(filename)
 4967: #     srate = csndlib.mus_sound_srate(filename)
 4968: #     bg = beg or 0
 4969: #     out = np.zeros(length, dtype=np.double)
 4970: #     
 4971: #     cdef double [:] out_view = None
 4972: #     out_view = out
 4973: # 
 4974: #     csndlib.mus_file_to_array(filename,channel, bg, length, &out_view[0])
 4975: #     return out
 4976: #     
 4977: # def channel2array(filename: str, channel: Optional[int]=0, beg: Optional[int]=None, dur: Optional[int]=None): 
 4978: #     length = dur or mus_sound_framples(filename)
 4979: #     srate = mus_sound_srate(filename)
 4980: #     bg = beg or 0
 4981: #     out = np.zeros((1, length), dtype=np.double)
 4982: #     mus_file_to_array(filename,channel, bg, length, out[0].ctypes.data_as(ctypes.pointer(ctypes.c_double)))
 4983: #     return out
 4984: # 
 4985: # def calc_length(start, dur):
 4986: #     st = seconds2samples(start)
 4987: #     nd = seconds2samples(start+dur)
 4988: #     return st, nd
 4989: # 
+4990: def convert_frequency(gen):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_543convert_frequency(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_543convert_frequency = {"convert_frequency", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_543convert_frequency, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_543convert_frequency(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert_frequency (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4990, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert_frequency") < 0)) __PYX_ERR(0, 4990, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convert_frequency", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4990, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.convert_frequency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_542convert_frequency(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_542convert_frequency(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert_frequency", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.convert_frequency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_543convert_frequency, 0, __pyx_n_s_convert_frequency, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__549)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 4990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_frequency, __pyx_t_37) < 0) __PYX_ERR(0, 4990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__549 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_convert_frequency, 4990, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__549)) __PYX_ERR(0, 4990, __pyx_L1_error)
+4991:     gen.frequency = hz2radians(gen.frequency)
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gen, __pyx_n_s_frequency); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_f_8pysndlib_3clm_hz2radians(__pyx_t_2, 0); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4991, __pyx_L1_error)
  __pyx_t_1 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_gen, __pyx_n_s_frequency, __pyx_t_1) < 0) __PYX_ERR(0, 4991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+4992:     return gen
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_gen);
  __pyx_r = __pyx_v_gen;
  goto __pyx_L0;
 4993: # 
 4994: 
+4995: cdef class array_readin_gen:
struct __pyx_obj_8pysndlib_3clm_array_readin_gen {
  PyObject_HEAD
  PyArrayObject *_arr;
  int _chan;
  PY_LONG_LONG _start;
  int _direction;
  PY_LONG_LONG _location;
  PY_LONG_LONG _length;
  float _val;
};

 4996:     cdef np.ndarray _arr
 4997:     cdef int _chan
 4998:     cdef cython.longlong _start
 4999:     cdef int _direction
 5000:     cdef cython.longlong _location
 5001:     cdef cython.longlong _length
 5002:     cdef float _val
 5003: 
+5004:     def __init__(self, arr: npt.NDArray[np.float64], chan: Optional[int]=0, start: Optional[int]=0, direction: Optional[int]=1):
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_16array_readin_gen_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8pysndlib_3clm_16array_readin_gen_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_chan = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_direction = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_chan,&__pyx_n_s_start,&__pyx_n_s_direction,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_1);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5004, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5004, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5004, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_direction);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5004, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 5004, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = values[0];
    __pyx_v_chan = values[1];
    __pyx_v_start = values[2];
    __pyx_v_direction = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 5004, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen___init__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self), __pyx_v_arr, __pyx_v_chan, __pyx_v_start, __pyx_v_direction);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_16array_readin_gen___init__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_chan, PyObject *__pyx_v_start, PyObject *__pyx_v_direction) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+5005:         check_ndim(arr, 2)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_arr, __pyx_int_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+5006:         self._arr = arr
  if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5006, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_arr;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_arr);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_arr);
  __pyx_v_self->_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
+5007:         self._chan = chan
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_chan); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5007, __pyx_L1_error)
  __pyx_v_self->_chan = __pyx_t_4;
+5008:         self._start = start
  __pyx_t_5 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_start); if (unlikely((__pyx_t_5 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 5008, __pyx_L1_error)
  __pyx_v_self->_start = __pyx_t_5;
+5009:         self._direction = direction
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_direction); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5009, __pyx_L1_error)
  __pyx_v_self->_direction = __pyx_t_4;
+5010:         self._location = self._start
  __pyx_t_5 = __pyx_v_self->_start;
  __pyx_v_self->_location = __pyx_t_5;
+5011:         self._length = np.shape(arr)[1]
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_arr};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_5 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 5011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->_length = __pyx_t_5;
 5012: 
+5013:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_11mus_channel_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_11mus_channel_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_11mus_channel___get__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_16array_readin_gen_11mus_channel___get__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.mus_channel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 5014:     def mus_channel(self):
+5015:         return self._chan
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_chan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 5016: 
+5017:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_12mus_location_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_12mus_location_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_12mus_location___get__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_16array_readin_gen_12mus_location___get__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.mus_location.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 5018:     def mus_location(self):
+5019:         return self._location
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->_location); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 5020: 
+5021:     @mus_location.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_16array_readin_gen_12mus_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_16array_readin_gen_12mus_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), (&PyInt_Type), 0, "v", 1))) __PYX_ERR(0, 5022, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_12mus_location_2__set__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self), ((PyObject*)__pyx_v_v));
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_16array_readin_gen_12mus_location_2__set__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.mus_location.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 5022:     def mus_location(self, v: int):
+5023:        self._location = v
  __pyx_t_1 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_v); if (unlikely((__pyx_t_1 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 5023, __pyx_L1_error)
  __pyx_v_self->_location = __pyx_t_1;
 5024: 
+5025:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_13mus_increment_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_13mus_increment_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_13mus_increment___get__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_16array_readin_gen_13mus_increment___get__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.mus_increment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 5026:     def mus_increment(self):
+5027:         return self._direction
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_direction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 5028: 
+5029:     @mus_increment.setter
/* Python wrapper */
static int __pyx_pw_8pysndlib_3clm_16array_readin_gen_13mus_increment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8pysndlib_3clm_16array_readin_gen_13mus_increment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), (&PyInt_Type), 0, "v", 1))) __PYX_ERR(0, 5030, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_13mus_increment_2__set__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self), ((PyObject*)__pyx_v_v));
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8pysndlib_3clm_16array_readin_gen_13mus_increment_2__set__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.mus_increment.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 5030:     def mus_increment(self, v: int):
+5031:         self._direction = v
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_v); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5031, __pyx_L1_error)
  __pyx_v_self->_direction = __pyx_t_1;
 5032: 
+5033:     @property
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_10mus_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_10mus_length_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_10mus_length___get__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_16array_readin_gen_10mus_length___get__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.mus_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 5034:     def mus_length(self):
+5035:         return self._length
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 5036: 
+5037:     def __call__(self):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8pysndlib_3clm_16array_readin_gen_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL;
  __pyx_r = __pyx_pf_8pysndlib_3clm_16array_readin_gen_2__call__(((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_16array_readin_gen_2__call__(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm.array_readin_gen.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+5038:         self._location = max(0, min(self._location, self._length-1))
  __pyx_t_1 = (__pyx_v_self->_length - 1);
  __pyx_t_2 = __pyx_v_self->_location;
  if ((__pyx_t_1 < __pyx_t_2)) {
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_4 = 0;
  if ((__pyx_t_1 > __pyx_t_4)) {
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  __pyx_v_self->_location = __pyx_t_3;
+5039:         self._val = self._arr[self._chan][self._location]
  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_arr), __pyx_v_self->_chan, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_self->_location, PY_LONG_LONG, 1, __Pyx_PyInt_From_PY_LONG_LONG, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 5039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->_val = __pyx_t_7;
+5040:         self._location += self._direction
  __pyx_v_self->_location = (__pyx_v_self->_location + __pyx_v_self->_direction);
+5041:         return self._val
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;
 5042: 
+5043: cpdef array_readin_gen make_array_readin(arr: npt.NDArray[np.float64], chan: Optional[int]=0, start: Optional[int]=0, direction: Optional[int]=1):
static PyObject *__pyx_pw_8pysndlib_3clm_545make_array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_f_8pysndlib_3clm_make_array_readin(PyObject *__pyx_v_arr, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8pysndlib_3clm_make_array_readin *__pyx_optional_args) {
  PyObject *__pyx_v_chan = ((PyObject *)__pyx_int_0);
  PyObject *__pyx_v_start = ((PyObject *)__pyx_int_0);
  PyObject *__pyx_v_direction = ((PyObject *)__pyx_int_1);
  struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_array_readin", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_chan = __pyx_optional_args->chan;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_start = __pyx_optional_args->start;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_direction = __pyx_optional_args->direction;
        }
      }
    }
  }
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.make_array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_545make_array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_545make_array_readin = {"make_array_readin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_545make_array_readin, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_545make_array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_chan = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_direction = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_array_readin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_chan,&__pyx_n_s_start,&__pyx_n_s_direction,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_1);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5043, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan);
          if (value) { values[1] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5043, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5043, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_direction);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5043, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_array_readin") < 0)) __PYX_ERR(0, 5043, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = values[0];
    __pyx_v_chan = values[1];
    __pyx_v_start = values[2];
    __pyx_v_direction = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_array_readin", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 5043, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_544make_array_readin(__pyx_self, __pyx_v_arr, __pyx_v_chan, __pyx_v_start, __pyx_v_direction);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_544make_array_readin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_chan, PyObject *__pyx_v_start, PyObject *__pyx_v_direction) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_array_readin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.chan = __pyx_v_chan;
  __pyx_t_2.start = __pyx_v_start;
  __pyx_t_2.direction = __pyx_v_direction;
  __pyx_t_1 = ((PyObject *)__pyx_f_8pysndlib_3clm_make_array_readin(__pyx_v_arr, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.make_array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__552 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_chan, __pyx_n_s_start, __pyx_n_s_direction); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(0, 5043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__552);
  __Pyx_GIVEREF(__pyx_tuple__552);
  __pyx_codeobj__553 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__552, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_array_readin, 5043, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__553)) __PYX_ERR(0, 5043, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_arr, __pyx_kp_s_npt_NDArray_np_float64) < 0) __PYX_ERR(0, 5043, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_chan, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 5043, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_start, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 5043, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_37, __pyx_n_s_direction, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 5043, __pyx_L1_error)
  __pyx_t_41 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_545make_array_readin, 0, __pyx_n_s_make_array_readin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__553)); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 5043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_41, __pyx_tuple__554);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_41, __pyx_t_37);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_array_readin, __pyx_t_41) < 0) __PYX_ERR(0, 5043, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_tuple__554 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(0, 5043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__554);
  __Pyx_GIVEREF(__pyx_tuple__554);
/* … */
struct __pyx_opt_args_8pysndlib_3clm_make_array_readin {
  int __pyx_n;
  PyObject *chan;
  PyObject *start;
  PyObject *direction;
};
+5044:     return array_readin_gen(arr, chan, start, direction)
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_arr);
  __Pyx_GIVEREF(__pyx_v_arr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
  __Pyx_INCREF(__pyx_v_chan);
  __Pyx_GIVEREF(__pyx_v_chan);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_chan);
  __Pyx_INCREF(__pyx_v_start);
  __Pyx_GIVEREF(__pyx_v_start);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_start);
  __Pyx_INCREF(__pyx_v_direction);
  __Pyx_GIVEREF(__pyx_v_direction);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_direction);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8pysndlib_3clm_array_readin_gen), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;
 5045: 
+5046: cpdef array_readin(gen: array_readin_gen):
static PyObject *__pyx_pw_8pysndlib_3clm_547array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_array_readin(struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_readin", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysndlib.clm.array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_547array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_547array_readin = {"array_readin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_547array_readin, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_547array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_readin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5046, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "array_readin") < 0)) __PYX_ERR(0, 5046, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = ((struct __pyx_obj_8pysndlib_3clm_array_readin_gen *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("array_readin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5046, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gen), __pyx_ptype_8pysndlib_3clm_array_readin_gen, 0, "gen", 0))) __PYX_ERR(0, 5046, __pyx_L1_error)
  __pyx_r = __pyx_pf_8pysndlib_3clm_546array_readin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_546array_readin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8pysndlib_3clm_array_readin_gen *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_readin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_array_readin(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_41 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 5046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (PyDict_SetItem(__pyx_t_41, __pyx_n_s_gen, __pyx_n_s_array_readin_gen) < 0) __PYX_ERR(0, 5046, __pyx_L1_error)
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_547array_readin, 0, __pyx_n_s_array_readin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__555)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_37, __pyx_t_41);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_readin, __pyx_t_37) < 0) __PYX_ERR(0, 5046, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__555 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_array_readin, 5046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__555)) __PYX_ERR(0, 5046, __pyx_L1_error)
+5047:     return gen()
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_gen);
  __pyx_t_2 = ((PyObject *)__pyx_v_gen); __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[1] = {__pyx_t_3, };
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 5048: 
+5049: cpdef is_array_readin(gen):
static PyObject *__pyx_pw_8pysndlib_3clm_549is_array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8pysndlib_3clm_is_array_readin(PyObject *__pyx_v_gen, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_array_readin", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysndlib.clm.is_array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_549is_array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_549is_array_readin = {"is_array_readin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_549is_array_readin, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_549is_array_readin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_array_readin (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5049, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_array_readin") < 0)) __PYX_ERR(0, 5049, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_array_readin", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5049, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.is_array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_548is_array_readin(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_548is_array_readin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gen) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_array_readin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8pysndlib_3clm_is_array_readin(__pyx_v_gen, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysndlib.clm.is_array_readin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_549is_array_readin, 0, __pyx_n_s_is_array_readin, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__556)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_array_readin, __pyx_t_37) < 0) __PYX_ERR(0, 5049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__556 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_array_readin, 5049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__556)) __PYX_ERR(0, 5049, __pyx_L1_error)
+5050:     return isinstance(gen, array_readin_gen)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_gen, __pyx_ptype_8pysndlib_3clm_array_readin_gen); 
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
 5051: 
 5052: 
 5053: 
 5054: 
 5055: 
 5056: 
 5057: 
 5058: # # todo: maybe add an exception that have to use keyword args
+5059: def make_generator(name, slots, wrapper=None, methods=None, docstring=None):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_551make_generator(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_551make_generator = {"make_generator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_551make_generator, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_551make_generator(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_slots = 0;
  PyObject *__pyx_v_wrapper = 0;
  PyObject *__pyx_v_methods = 0;
  PyObject *__pyx_v_docstring = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_generator (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_slots,&__pyx_n_s_wrapper,&__pyx_n_s_methods,&__pyx_n_s_docstring,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5059, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_slots)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5059, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("make_generator", 0, 2, 5, 1); __PYX_ERR(0, 5059, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wrapper);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5059, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_methods);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5059, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_docstring);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5059, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_generator") < 0)) __PYX_ERR(0, 5059, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_slots = values[1];
    __pyx_v_wrapper = values[2];
    __pyx_v_methods = values[3];
    __pyx_v_docstring = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_generator", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 5059, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_generator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_550make_generator(__pyx_self, __pyx_v_name, __pyx_v_slots, __pyx_v_wrapper, __pyx_v_methods, __pyx_v_docstring);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_550make_generator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_slots, PyObject *__pyx_v_wrapper, PyObject *__pyx_v_methods, PyObject *__pyx_v_docstring) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *__pyx_cur_scope;
  PyObject *__pyx_v_make_generator = 0;
  PyObject *__pyx_v_is_a = 0;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_generator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct_5_make_generator(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct_5_make_generator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 5059, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);
  __pyx_cur_scope->__pyx_v_wrapper = __pyx_v_wrapper;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wrapper);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_wrapper);
  __pyx_cur_scope->__pyx_v_methods = __pyx_v_methods;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_methods);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_methods);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_generator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_make_generator);
  __Pyx_XDECREF(__pyx_v_is_a);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__557 = PyTuple_Pack(11, __pyx_n_s_name, __pyx_n_s_slots, __pyx_n_s_wrapper, __pyx_n_s_methods, __pyx_n_s_docstring, __pyx_n_s_mus_gen, __pyx_n_s_make_generator, __pyx_n_s_make_generator, __pyx_n_s_is_a, __pyx_n_s_is_a, __pyx_n_s_g); if (unlikely(!__pyx_tuple__557)) __PYX_ERR(0, 5059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__557);
  __Pyx_GIVEREF(__pyx_tuple__557);
  __pyx_codeobj__558 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__557, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_generator, 5059, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__558)) __PYX_ERR(0, 5059, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_551make_generator, 0, __pyx_n_s_make_generator, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__558)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__559);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_generator, __pyx_t_37) < 0) __PYX_ERR(0, 5059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__559 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__559)) __PYX_ERR(0, 5059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__559);
  __Pyx_GIVEREF(__pyx_tuple__559);
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator {
  PyObject_HEAD
  PyObject *__pyx_v_methods;
  PyObject *__pyx_v_mus_gen;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_wrapper;
};

+5060:     class mus_gen():
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_mus_gen, __pyx_n_s_make_generator_locals_mus_gen, (PyObject *) NULL, __pyx_n_s_pysndlib_clm, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_mus_gen, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_mus_gen = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 5061:         pass
+5062:     def make_generator(**kwargs):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_14make_generator_1make_generator(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_14make_generator_1make_generator = {"make_generator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_14make_generator_1make_generator, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_14make_generator_1make_generator(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_generator (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("make_generator", 1, 0, 0, __pyx_nargs); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "make_generator", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __pyx_r = __pyx_pf_8pysndlib_3clm_14make_generator_make_generator(__pyx_self, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_14make_generator_make_generator(PyObject *__pyx_self, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *__pyx_outer_scope;
  PyObject *__pyx_v_gen = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_generator", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pysndlib.clm.make_generator.make_generator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_gen);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__63 = PyTuple_Pack(4, __pyx_n_s_kwargs, __pyx_n_s_gen, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 5062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_14make_generator_1make_generator, 0, __pyx_n_s_make_generator_locals_make_gener, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_make_generator = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_make_generator, 5062, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 5062, __pyx_L1_error)
+5063:         gen = mus_gen()
  if (unlikely(!__pyx_cur_scope->__pyx_v_mus_gen)) { __Pyx_RaiseClosureNameError("mus_gen"); __PYX_ERR(0, 5063, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_mus_gen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gen = __pyx_t_1;
  __pyx_t_1 = 0;
+5064:         setattr(gen, 'name', name)
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 5064, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_name;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_SetAttr(__pyx_v_gen, __pyx_n_s_name, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+5065:         for k, v  in kwargs.items():
  __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
    __pyx_t_7 = 0;
+5066:             setattr(gen, k, v)
    __pyx_t_2 = PyObject_SetAttr(__pyx_v_gen, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5066, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+5067:         if methods:
  if (unlikely(!__pyx_cur_scope->__pyx_v_methods)) { __Pyx_RaiseClosureNameError("methods"); __PYX_ERR(0, 5067, __pyx_L1_error) }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_methods); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 5067, __pyx_L1_error)
  if (__pyx_t_9) {
/* … */
  }
+5068:             for k, v  in methods.items():
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_methods)) { __Pyx_RaiseClosureNameError("methods"); __PYX_ERR(0, 5068, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_v_methods == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 5068, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_methods, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_4, &__pyx_t_7, &__pyx_t_6, NULL, __pyx_t_5);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 5068, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
      __pyx_t_6 = 0;
+5069:                 setattr(mus_gen, k, property(v[0], v[1], None) )
      if (unlikely(!__pyx_cur_scope->__pyx_v_mus_gen)) { __Pyx_RaiseClosureNameError("mus_gen"); __PYX_ERR(0, 5069, __pyx_L1_error) }
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_mus_gen;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_v, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None);
      __pyx_t_7 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5069, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_2 = PyObject_SetAttr(__pyx_t_6, __pyx_v_k, __pyx_t_10); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5069, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 5070: 
+5071:         return gen if not wrapper else wrapper(gen)
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_wrapper)) { __Pyx_RaiseClosureNameError("wrapper"); __PYX_ERR(0, 5071, __pyx_L1_error) }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_wrapper); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 5071, __pyx_L1_error)
  if ((!__pyx_t_9)) {
    __Pyx_INCREF(__pyx_v_gen);
    __pyx_t_1 = __pyx_v_gen;
  } else {
    if (unlikely(!__pyx_cur_scope->__pyx_v_wrapper)) { __Pyx_RaiseClosureNameError("wrapper"); __PYX_ERR(0, 5071, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wrapper);
    __pyx_t_6 = __pyx_cur_scope->__pyx_v_wrapper; __pyx_t_11 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_gen};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_1 = __pyx_t_10;
    __pyx_t_10 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
+5072:     def is_a(gen):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_14make_generator_3is_a(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_14make_generator_3is_a = {"is_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_14make_generator_3is_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_14make_generator_3is_a(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_a (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gen,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_gen)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5072, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_a") < 0)) __PYX_ERR(0, 5072, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_gen = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_a", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5072, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.make_generator.is_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_14make_generator_2is_a(__pyx_self, __pyx_v_gen);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_14make_generator_2is_a(PyObject *__pyx_self, PyObject *__pyx_v_gen) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_a", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_5_make_generator *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.make_generator.is_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_14make_generator_3is_a, 0, __pyx_n_s_make_generator_locals_is_a, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_is_a = __pyx_t_1;
  __pyx_t_1 = 0;
/* … */
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_is_a, 5072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 5072, __pyx_L1_error)
+5073:         return isinstance(gen, mus_gen) and gen.name == name
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mus_gen)) { __Pyx_RaiseClosureNameError("mus_gen"); __PYX_ERR(0, 5073, __pyx_L1_error) }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_mus_gen;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_gen, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 5073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_gen, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 5073, __pyx_L1_error) }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_cur_scope->__pyx_v_name, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
+5074:     g =  partial(make_generator, **slots)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_make_generator);
  __Pyx_GIVEREF(__pyx_v_make_generator);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_make_generator);
  if (unlikely(__pyx_v_slots == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(0, 5074, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_slots))) {
    __pyx_t_3 = PyDict_Copy(__pyx_v_slots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_slots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_g = __pyx_t_4;
  __pyx_t_4 = 0;
+5075:     if docstring is not None:
  __pyx_t_5 = (__pyx_v_docstring != Py_None);
  if (__pyx_t_5) {
/* … */
  }
+5076:         g.__doc__ = docstring
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_g, __pyx_n_s_doc, __pyx_v_docstring) < 0) __PYX_ERR(0, 5076, __pyx_L1_error)
 5077: 
+5078:     return g, is_a
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_g);
  __Pyx_GIVEREF(__pyx_v_g);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_g);
  __Pyx_INCREF(__pyx_v_is_a);
  __Pyx_GIVEREF(__pyx_v_is_a);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_is_a);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;
 5079: 
 5080: 
 5081: 
+5082: def _clip(x, lo, hi):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_553_clip(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_553_clip = {"_clip", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_553_clip, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_553_clip(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_lo = 0;
  PyObject *__pyx_v_hi = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_clip (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_lo,&__pyx_n_s_hi,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5082, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lo)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5082, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_clip", 1, 3, 3, 1); __PYX_ERR(0, 5082, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hi)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5082, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_clip", 1, 3, 3, 2); __PYX_ERR(0, 5082, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_clip") < 0)) __PYX_ERR(0, 5082, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_x = values[0];
    __pyx_v_lo = values[1];
    __pyx_v_hi = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_clip", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5082, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_552_clip(__pyx_self, __pyx_v_x, __pyx_v_lo, __pyx_v_hi);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_552_clip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_lo, PyObject *__pyx_v_hi) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_clip", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm._clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__560 = PyTuple_Pack(3, __pyx_n_s_x, __pyx_n_s_lo, __pyx_n_s_hi); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(0, 5082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__560);
  __Pyx_GIVEREF(__pyx_tuple__560);
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_553_clip, 0, __pyx_n_s_clip, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__561)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clip, __pyx_t_37) < 0) __PYX_ERR(0, 5082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__561 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__560, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clip, 5082, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__561)) __PYX_ERR(0, 5082, __pyx_L1_error)
+5083:     return max(min(x, hi),lo)
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_lo);
  __pyx_t_1 = __pyx_v_lo;
  __Pyx_INCREF(__pyx_v_hi);
  __pyx_t_2 = __pyx_v_hi;
  __Pyx_INCREF(__pyx_v_x);
  __pyx_t_3 = __pyx_v_x;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5083, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 5083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __pyx_t_2;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5083, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 5083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  goto __pyx_L0;
 5084: 
+5085: def clamp(x, lo, hi):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_555clamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_555clamp = {"clamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_555clamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_555clamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_lo = 0;
  PyObject *__pyx_v_hi = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clamp (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_lo,&__pyx_n_s_hi,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lo)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("clamp", 1, 3, 3, 1); __PYX_ERR(0, 5085, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hi)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5085, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("clamp", 1, 3, 3, 2); __PYX_ERR(0, 5085, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clamp") < 0)) __PYX_ERR(0, 5085, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_x = values[0];
    __pyx_v_lo = values[1];
    __pyx_v_hi = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clamp", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5085, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_554clamp(__pyx_self, __pyx_v_x, __pyx_v_lo, __pyx_v_hi);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_554clamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_lo, PyObject *__pyx_v_hi) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clamp", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysndlib.clm.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_555clamp, 0, __pyx_n_s_clamp, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__562)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clamp, __pyx_t_37) < 0) __PYX_ERR(0, 5085, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
/* … */
  __pyx_codeobj__562 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__560, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_clamp, 5085, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__562)) __PYX_ERR(0, 5085, __pyx_L1_error)
+5086:     return max(min(x, hi),lo)
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_lo);
  __pyx_t_1 = __pyx_v_lo;
  __Pyx_INCREF(__pyx_v_hi);
  __pyx_t_2 = __pyx_v_hi;
  __Pyx_INCREF(__pyx_v_x);
  __pyx_t_3 = __pyx_v_x;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5086, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 5086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __pyx_t_2;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5086, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 5086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  goto __pyx_L0;
 5087: 
+5088: def _wrap(x, lo, hi):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_557_wrap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_557_wrap = {"_wrap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_557_wrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_557_wrap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_lo = 0;
  PyObject *__pyx_v_hi = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_wrap (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_lo,&__pyx_n_s_hi,0};
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5088, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lo)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5088, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_wrap", 1, 3, 3, 1); __PYX_ERR(0, 5088, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hi)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5088, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_wrap", 1, 3, 3, 2); __PYX_ERR(0, 5088, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_wrap") < 0)) __PYX_ERR(0, 5088, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_x = values[0];
    __pyx_v_lo = values[1];
    __pyx_v_hi = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_wrap", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 5088, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm._wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_556_wrap(__pyx_self, __pyx_v_x, __pyx_v_lo, __pyx_v_hi);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_556_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_lo, PyObject *__pyx_v_hi) {
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_wrap", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysndlib.clm._wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__563 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_lo, __pyx_n_s_hi, __pyx_n_s_r); if (unlikely(!__pyx_tuple__563)) __PYX_ERR(0, 5088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__563);
  __Pyx_GIVEREF(__pyx_tuple__563);
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_557_wrap, 0, __pyx_n_s_wrap, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__564)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wrap, __pyx_t_37) < 0) __PYX_ERR(0, 5088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__564 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__563, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_wrap, 5088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__564)) __PYX_ERR(0, 5088, __pyx_L1_error)
+5089:     r = hi-lo
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_hi, __pyx_v_lo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_r = __pyx_t_1;
  __pyx_t_1 = 0;
+5090:     if x >= lo and x <= hi:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_x, __pyx_v_lo, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5090, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 5090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_x, __pyx_v_hi, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5090, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 5090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {
/* … */
  }
+5091:         return x
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_x);
    __pyx_r = __pyx_v_x;
    goto __pyx_L0;
+5092:     if x < lo:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_x, __pyx_v_lo, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5092, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 5092, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
/* … */
  }
+5093:         return hi + (math.fmod((x-lo), r))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fmod); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_x, __pyx_v_lo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_r};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5093, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyNumber_Add(__pyx_v_hi, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
+5094:     if x > hi:
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_x, __pyx_v_hi, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5094, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 5094, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {
/* … */
  }
+5095:         return lo + (math.fmod((x-hi), r))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fmod); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_hi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_r};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = PyNumber_Add(__pyx_v_lo, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
 5096: 
+5097: def array_reader(arr, chan, loop=0):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_559array_reader(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_559array_reader = {"array_reader", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_559array_reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_559array_reader(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_chan = 0;
  PyObject *__pyx_v_loop = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_reader (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_chan,&__pyx_n_s_loop,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)__pyx_int_0));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arr)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5097, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chan)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5097, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("array_reader", 0, 2, 3, 1); __PYX_ERR(0, 5097, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loop);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5097, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "array_reader") < 0)) __PYX_ERR(0, 5097, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = values[0];
    __pyx_v_chan = values[1];
    __pyx_v_loop = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("array_reader", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 5097, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_558array_reader(__pyx_self, __pyx_v_arr, __pyx_v_chan, __pyx_v_loop);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
static PyObject *__pyx_pf_8pysndlib_3clm_558array_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_chan, PyObject *__pyx_v_loop) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *__pyx_cur_scope;
  PyObject *__pyx_v_reader = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array_reader", 0);
  __pyx_cur_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *)__pyx_tp_new_8pysndlib_3clm___pyx_scope_struct_6_array_reader(__pyx_ptype_8pysndlib_3clm___pyx_scope_struct_6_array_reader, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 5097, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_arr = __pyx_v_arr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arr);
  __pyx_cur_scope->__pyx_v_chan = __pyx_v_chan;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_chan);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_chan);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pysndlib.clm.array_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reader);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__565 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_chan, __pyx_n_s_loop, __pyx_n_s_ind, __pyx_n_s_length, __pyx_n_s_reader, __pyx_n_s_reader, __pyx_n_s_reader); if (unlikely(!__pyx_tuple__565)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__565);
  __Pyx_GIVEREF(__pyx_tuple__565);
  __pyx_codeobj__566 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__565, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_array_reader, 5097, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__566)) __PYX_ERR(0, 5097, __pyx_L1_error)
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_559array_reader, 0, __pyx_n_s_array_reader, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__566)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_37, __pyx_tuple__567);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_reader, __pyx_t_37) < 0) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_tuple__567 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__567)) __PYX_ERR(0, 5097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__567);
  __Pyx_GIVEREF(__pyx_tuple__567);
/* … */
struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader {
  PyObject_HEAD
  PyObject *__pyx_v_arr;
  PyObject *__pyx_v_chan;
  PyObject *__pyx_v_ind;
  PyObject *__pyx_v_length;
};

+5098:     ind = 0
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_cur_scope->__pyx_v_ind = __pyx_int_0;
+5099:     if chan > (clm_channels(arr)):
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_arr};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_chan, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5099, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 5099, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_5)) {
/* … */
  }
+5100:         raise ValueError(f'array has {clm_channels(arr)} channels but {chan} asked for')
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_array_has);
    __pyx_t_6 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_array_has);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_array_has);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_clm_channels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_arr};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_channels_but);
    __pyx_t_6 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_channels_but);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_channels_but);
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_chan, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_asked_for);
    __pyx_t_6 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_asked_for);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_asked_for);
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 5100, __pyx_L1_error)
+5101:     length = clm_length(arr)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_clm_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_arr};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_length = __pyx_t_2;
  __pyx_t_2 = 0;
+5102:     if loop:
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_loop); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 5102, __pyx_L1_error)
  if (__pyx_t_5) {
/* … */
    goto __pyx_L4;
  }
+5103:         def reader(direction):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_12array_reader_1reader(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_12array_reader_1reader = {"reader", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_12array_reader_1reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_12array_reader_1reader(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_direction = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reader (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_direction,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_direction)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5103, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reader") < 0)) __PYX_ERR(0, 5103, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_direction = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reader", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5103, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_reader.reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_12array_reader_reader(__pyx_self, __pyx_v_direction);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_12array_reader_reader(PyObject *__pyx_self, PyObject *__pyx_v_direction) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *__pyx_outer_scope;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reader", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.array_reader.reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_direction, __pyx_n_s_v); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 5103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
/* … */
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_12array_reader_1reader, 0, __pyx_n_s_array_reader_locals_reader, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_reader = __pyx_t_2;
    __pyx_t_2 = 0;
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_reader, 5103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 5103, __pyx_L1_error)
 5104:             nonlocal ind
+5105:             v = arr[chan][ind]
  if (unlikely(!__pyx_cur_scope->__pyx_v_arr)) { __Pyx_RaiseClosureNameError("arr"); __PYX_ERR(0, 5105, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_chan)) { __Pyx_RaiseClosureNameError("chan"); __PYX_ERR(0, 5105, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_arr, __pyx_cur_scope->__pyx_v_chan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_ind)) { __Pyx_RaiseClosureNameError("ind"); __PYX_ERR(0, 5105, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_v = __pyx_t_2;
  __pyx_t_2 = 0;
+5106:             ind += direction
  if (unlikely(!__pyx_cur_scope->__pyx_v_ind)) { __Pyx_RaiseClosureNameError("ind"); __PYX_ERR(0, 5106, __pyx_L1_error) }
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_ind, __pyx_v_direction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ind);
  __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ind, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
+5107:             ind = _wrap(ind, 0, length-1)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_wrap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_length)) { __Pyx_RaiseClosureNameError("length"); __PYX_ERR(0, 5107, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_length, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_ind, __pyx_int_0, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ind);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ind, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
+5108:             return v
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_v);
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;
 5109: 
 5110:     else:
+5111:         def reader(direction):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_12array_reader_3reader(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_12array_reader_3reader = {"reader", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_12array_reader_3reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_12array_reader_3reader(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_direction = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reader (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_direction,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_direction)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5111, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reader") < 0)) __PYX_ERR(0, 5111, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_direction = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reader", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5111, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.array_reader.reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_12array_reader_2reader(__pyx_self, __pyx_v_direction);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_12array_reader_2reader(PyObject *__pyx_self, PyObject *__pyx_v_direction) {
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *__pyx_cur_scope;
  struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *__pyx_outer_scope;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reader", 0);
  __pyx_outer_scope = (struct __pyx_obj_8pysndlib_3clm___pyx_scope_struct_6_array_reader *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.array_reader.reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  /*else*/ {
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_12array_reader_3reader, 0, __pyx_n_s_array_reader_locals_reader, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_reader = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;
/* … */
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_reader, 5111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 5111, __pyx_L1_error)
 5112:             nonlocal ind
+5113:             v = arr[chan][ind]
  if (unlikely(!__pyx_cur_scope->__pyx_v_arr)) { __Pyx_RaiseClosureNameError("arr"); __PYX_ERR(0, 5113, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_chan)) { __Pyx_RaiseClosureNameError("chan"); __PYX_ERR(0, 5113, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_arr, __pyx_cur_scope->__pyx_v_chan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_ind)) { __Pyx_RaiseClosureNameError("ind"); __PYX_ERR(0, 5113, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_v = __pyx_t_2;
  __pyx_t_2 = 0;
+5114:             ind += direction
  if (unlikely(!__pyx_cur_scope->__pyx_v_ind)) { __Pyx_RaiseClosureNameError("ind"); __PYX_ERR(0, 5114, __pyx_L1_error) }
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_ind, __pyx_v_direction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ind);
  __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ind, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
+5115:             ind = _clip(ind, 0, length-1)
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_length)) { __Pyx_RaiseClosureNameError("length"); __PYX_ERR(0, 5115, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_length, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_ind, __pyx_int_0, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ind);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ind, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
+5116:             return v
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_v);
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;
+5117:     return reader
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_reader);
  __pyx_r = __pyx_v_reader;
  goto __pyx_L0;
 5118: 
+5119: def sndplay(file):
/* Python wrapper */
static PyObject *__pyx_pw_8pysndlib_3clm_561sndplay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8pysndlib_3clm_561sndplay = {"sndplay", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pysndlib_3clm_561sndplay, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8pysndlib_3clm_561sndplay(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sndplay (wrapper)", 0);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,0};
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5119, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sndplay") < 0)) __PYX_ERR(0, 5119, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_file = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sndplay", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 5119, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysndlib.clm.sndplay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8pysndlib_3clm_560sndplay(__pyx_self, __pyx_v_file);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8pysndlib_3clm_560sndplay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sndplay", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysndlib.clm.sndplay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__568 = PyTuple_Pack(1, __pyx_n_s_file); if (unlikely(!__pyx_tuple__568)) __PYX_ERR(0, 5119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__568);
  __Pyx_GIVEREF(__pyx_tuple__568);
/* … */
  __pyx_t_37 = __Pyx_CyFunction_New(&__pyx_mdef_8pysndlib_3clm_561sndplay, 0, __pyx_n_s_sndplay, NULL, __pyx_n_s_pysndlib_clm, __pyx_d, ((PyObject *)__pyx_codeobj__569)); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 5119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sndplay, __pyx_t_37) < 0) __PYX_ERR(0, 5119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_codeobj__569 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__568, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pysndlib_clm_pyx, __pyx_n_s_sndplay, 5119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__569)) __PYX_ERR(0, 5119, __pyx_L1_error)
+5120:     subprocess.run([CLM.player,file])
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_run); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CLM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_player); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_file);
  __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 5121: 
 5122: 
 5123: 
 5124: